Possible to set space seperated scopes in the settings
This commit is contained in:
parent
96b8b17612
commit
b6713cf0dc
|
@ -106,7 +106,7 @@ class GenericOAuth2Provider extends Base implements OAuthAuthenticationProviderI
|
|||
$this->helper->url->to('OAuthController', 'handler', array('plugin' => 'OAuth2'), '', true),
|
||||
$this->getOAuthAuthorizeUrl(),
|
||||
$this->getOAuthTokenUrl(),
|
||||
array()
|
||||
$this->getScopes()
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -160,6 +160,18 @@ class GenericOAuth2Provider extends Base implements OAuthAuthenticationProviderI
|
|||
return $this->configModel->get('oauth2_client_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get scopes
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getScopes()
|
||||
{
|
||||
return explode(" ", $this->configModel->get('oauth2_scopes'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get client secret
|
||||
*
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
<?= $this->form->label(t('User API URL'), 'oauth2_user_api_url') ?>
|
||||
<?= $this->form->text('oauth2_user_api_url', $values) ?>
|
||||
|
||||
<?= $this->form->label(t('Scopes'), 'oauth2_scopes') ?>
|
||||
<?= $this->form->text('oauth2_scopes', $values) ?>
|
||||
|
||||
<?= $this->form->label(t('Username Key'), 'oauth2_key_username') ?>
|
||||
<?= $this->form->text('oauth2_key_username', $values) ?>
|
||||
|
||||
|
|
Loading…
Reference in New Issue