Skip to content

Commit 13d3846

Browse files
authored
Merge pull request #5
Support for setting scope
2 parents 96b8b17 + b6713cf commit 13d3846

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

Auth/GenericOAuth2Provider.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function getService()
106106
$this->helper->url->to('OAuthController', 'handler', array('plugin' => 'OAuth2'), '', true),
107107
$this->getOAuthAuthorizeUrl(),
108108
$this->getOAuthTokenUrl(),
109-
array()
109+
$this->getScopes()
110110
);
111111
}
112112

@@ -160,6 +160,18 @@ public function getClientId()
160160
return $this->configModel->get('oauth2_client_id');
161161
}
162162

163+
/**
164+
* Get scopes
165+
*
166+
* @access public
167+
* @return array
168+
*/
169+
public function getScopes()
170+
{
171+
return explode(" ", $this->configModel->get('oauth2_scopes'));
172+
}
173+
174+
163175
/**
164176
* Get client secret
165177
*

Template/config/integration.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<?= $this->form->label(t('User API URL'), 'oauth2_user_api_url') ?>
1919
<?= $this->form->text('oauth2_user_api_url', $values) ?>
2020

21+
<?= $this->form->label(t('Scopes'), 'oauth2_scopes') ?>
22+
<?= $this->form->text('oauth2_scopes', $values) ?>
23+
2124
<?= $this->form->label(t('Username Key'), 'oauth2_key_username') ?>
2225
<?= $this->form->text('oauth2_key_username', $values) ?>
2326

0 commit comments

Comments
 (0)