This commit is contained in:
parent
f7da174c1a
commit
2cbddcb2b5
|
|
@ -0,0 +1,43 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace wp-xwiki\FlarumOAuthEntra\Providers;
|
||||||
|
|
||||||
|
use FoF\OAuth\Providers\AbstractProvider;
|
||||||
|
use League\OAuth2\Client\Provider\GenericProvider;
|
||||||
|
|
||||||
|
class EntraProvider extends AbstractProvider
|
||||||
|
{
|
||||||
|
public function options()
|
||||||
|
{
|
||||||
|
$tenant = resolve('flarum.settings')->get('sbp-entraid.tenant') ?: 'common';
|
||||||
|
|
||||||
|
return [
|
||||||
|
'clientId' => $this->settings->get('fof-oauth.microsoft.client_id'),
|
||||||
|
'clientSecret' => $this->settings->get('fof-oauth.microsoft.client_secret'),
|
||||||
|
'redirectUri' => $this->url->to('forum')->route('auth.msoft'),
|
||||||
|
'urlAuthorize' => "https://login.microsoftonline.com/{$tenant}/oauth2/v2.0/authorize",
|
||||||
|
'urlAccessToken' => "https://login.microsoftonline.com/{$tenant}/oauth2/v2.0/token",
|
||||||
|
'urlResourceOwnerDetails' => "https://graph.microsoft.com/v1.0/me"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function provider()
|
||||||
|
{
|
||||||
|
return new GenericProvider($this->options());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getId()
|
||||||
|
{
|
||||||
|
return 'entra';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDisplayName()
|
||||||
|
{
|
||||||
|
return 'Microsoft Entra ID';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIcon()
|
||||||
|
{
|
||||||
|
return 'fab fa-microsoft';
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue