Download the PHP package blankogmbh/kirby-oauth without Composer
On this page you can find all versions of the php package blankogmbh/kirby-oauth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download blankogmbh/kirby-oauth
More information about blankogmbh/kirby-oauth
Files in blankogmbh/kirby-oauth
Package kirby-oauth
Short Description Kirby OAuth 2 Plugin
License MIT
Homepage https://github.com/thathoff/kirby-oauth
Informations about the package kirby-oauth
Kirby OAuth 2.0 Plugin
This plugin is an plugin to provide OAuth 2.0 support for panel authentication in Kirby. It uses the PHP League’s OAuth 2 Client, so all official and third-party providers are supported. It’s even possible to implement your own.
Kirby Compatibility
- For Kirby 4 use version 3.0.0 or higher
- For Kirby 3.6 - 3.9 use version 2 or higher
- For Kirby 3.0 - 3.6 use version 1 (not maintained anymore)
Installation with Composer
Because of secondary dependencies for providers, installation via composer is the only currently supported method.
Install the Plugin
Install a Provider
The Plugin uses PHP League’s OAuth 2 Client so you can select from all official and third-party providers. It’s also possible to use your own provider by using the GenericProvider
or implement your own provider.
For example to install support for Google run:
Options
General Options
The following configuration options are available. And can be added to the Kirby config.php
.
Provider Options
The thathoff.oauth.providers
array is a list of all configured OAuth Providers with a unique key for each entry. Each array entry is used as the configuration option to a new OAauth Provider Class instance so all options which are documented for the selected OAuth Provider class are available.
Additionally the two properties name
and class
are supported to supply a display name for the login screen and the Provider class to use when you don’t want to use the GenericProvider
.
Redirect URL
OAuth providers require you to supply a redirect URL when configuring an application.
Please use https://example.com/oauth/login/PROVIDER_ID
where example.com is your domain and PROVIDER_ID is the key
of the config option in config.php (in the previous config example google
or custom
). If you have
installed Kirby in a subdirectory, remember to include the subdirectory in the URL.
Configure Allowed Users
By default only whitelisted users are allowed to login into the Kirby panel.
Domain Whitelist: By adding domains to the domain whitelist (domainWhitelist
) all accounts with a verified email address at one of the domains are permitted.
Email Whitelist: By adding email addresses to the email whitelist (emailWhitelist
) all accounts with a verified email address matching one of the entires are permitted.
Allow Everyone: By setting allowEveryone
to true
all authenticated accounts are able to login. Please use this option with care! You probably want to change the default user role to a more restricted one then the default admin
.
Default Role: Newly created users get the role defined with defaultRole
when they first login. The default is admin
. Please note that when the user has ben created already the role will not be updated. You can set this role to nobody
if you want to manually whitelist users by changing the role in the Kirby panel.
Only Existing User: By setting onlyExistingUsers
to true only created uses are able to login with an OAuth provider, no new users are created.