Open Anders-HM opened 4 years ago
Try this:
In your app/Providers/AppServiceProvider.php
's boot
method, add:
public function boot()
{
\Laravel\Socialite\Facades\Socialite::with('graph')->setTenantId('a-microsoft-tenant-id');
}
I get the following error message.
InvalidArgumentException Driver [graph] not supported.
What does your config/statamic/oauth.php
file look like?
<?php
return [
'enabled' => env('STATAMIC_OAUTH_ENABLED', false),
'providers' => [
'graph' => 'Office365',
],
'routes' => [
'login' => 'oauth/{provider}',
'callback' => 'oauth/{provider}/callback'
],
];
Ah it works a bit differently than I thought. Okay, we'll need to add a nice way for you to hook in where necessary.
Sounds good, thank you for the quick reply!
This issue has not had recent activity and has been marked as stale — by me, a robot. Simply reply to keep it open and send me away. If you do nothing, I will close it in a week. I have no feelings, so whatever you do is fine by me.
This is still a feature I would like to have in Statamic
I'm currently using Oauth/Socialite for authentication with the Microsoft Graph provider and it works beautifully. The only thing I can't get to work is using a single tenant instead of using the "common" setting, which requires using a multi tenancy setting in Microsoft Graph. Using a single tenant is required to limit logins to only those in our Office365 domain, which is a design requirement.
In the Socialite provider documentation there is a section on setting the tenant id, it requires the following code:
return Socialite::with('graph')->setTenantId('a-microsoft-tenant-id')->redirect();
But there is no way of using this code in Statamic's settings files. I did find a workaround, which was to edit a file called Oauthcontroller in the vendor folder, using the code above, but that doesn't seem like a very good solution.