Login to Craft with third-party services like Azure and Google.
This plugin requires Craft CMS 3.0.0-beta.23 or later.
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require thecodezone/socialite
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for socialite.
Provides turn-key social auth to CraftCMS.
The following services are supported:
- Generic social providers
- Azure
return [
'providers' => [
'generic' => [
'clientId' => getenv('SERVICE_ID'), // The client ID assigned to you by the provider
'clientSecret' => getenv('SERVICE_SECRET'), // The client password assigned to you by the provider
'urlAuthorize' => 'https://example.com/oauth2/lockdin/authorize',
'urlAccessToken' => 'https://example.com/oauth2/lockdin/token',
'urlResourceOwnerDetails' => 'https://example.com/oauth2/lockdin/resource'
],
'azure' => [
'clientId' => getenv('AZURE_CLIENT_ID'),
'clientSecret' => getenv('AZURE_CLIENT_SECRET')
],
'google' => [
'clientId' => getenv('GOOGLE_CLIENT_ID'),
'clientSecret' => getenv('GOOGLE_CLIENT_SECRET'),
'hostedDomain' => getenv('GOOGLE_HOSTED_DOMAIN'),
]
]
];
<a href="{{ craft.socialite.url('azure') }}">
Login with Azure
</a>
<a href="{{ craft.socialite.url('google') }}">
Login with Google
</a>
- Add more services.
Brought to you by CodeZone