This plugin is a Kirby extension that allows you to authenticate users via OAuth2 and their email address.
This plugin implements the OAuth2 flow for the following providers:
- Microsoft
- Yahoo
- Azure
composer require nerdcel/kirby-oauth2-email
Or download the latest release unzip it, copy it to site/plugins/kirby-oauth2-email
.
You need to configure your OAuth2 provider to allow the authentication of your users. You need to create an OAuth2 application and get the client ID and client secret. At this point, I assume you have a basic understanding of OAuth2 and how to setup your provider.
You most likely need to provide a redirect URL, which is https://your-site.tld/callback-path
.
If this step is done, you can configure the plugin using the refresh token, client ID, and client secret (tenantId e.g. Azure).
Once this is done you can configure the plugin.
Edit your config.php
and add the following lines:
'nerdcel.kirby-oauth2-email' => [
'callback-path' => 'callback-path', // default: 'email/oauth2'
'enabled' => true, // default: false
'email' => '[email protected]',
'service' => 'azure', // google, microsoft, yahoo, azure
'client-id' => 'your-client-id',
'client-secret' => 'your-client-secret',
'tenant-id' => 'your-tenant-id', // only for azure
'refresh-token' => 'your-refresh-token', // received from the first login
]
After you have configured the plugin, you should be able to send emails for example using the dreamform plugin or when you use the 2FA option for the panel.