Skip to content
Snippets Groups Projects
Unverified Commit 28a7ade1 authored by Andreas Gohr's avatar Andreas Gohr Committed by GitHub
Browse files

Merge pull request #7 from mittelab/master

Handle the state parameter in callback URL.
parents fde2b1b7 82cf301d
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,11 @@ use OAuth\Common\Http\Uri\Uri;
*/
class Generic extends AbstractOAuth2Base
{
/** @inheritdoc */
public function needsStateParameterInAuthUrl() {
$plugin = plugin_load('helper', 'oauthgeneric');
return 0 !== $plugin->getConf('needs-state');
}
/** @inheritdoc */
public function getAuthorizationEndpoint()
......
......@@ -11,6 +11,7 @@ $conf['tokenurl'] = '';
$conf['userurl'] = '';
$conf['authmethod'] = 0;
$conf['scopes'] = '';
$conf['needs-state'] = 0;
$conf['json-user'] = '';
$conf['json-name'] = '';
......
......@@ -11,6 +11,7 @@ $meta['tokenurl'] = array('string');
$meta['userurl'] = array('string');
$meta['authmethod'] = array('multichoice', '_choices' => [0, 1, 6, 2, 3, 4, 5]);
$meta['scopes'] = array('array');
$meta['needs-state'] = array('onoff');
$meta['json-user'] = array('string');
$meta['json-name'] = array('string');
......
......@@ -11,8 +11,8 @@ $lang['authurl'] = 'URL pro autentizaci';
$lang['tokenurl'] = 'URL pro získání tokenu';
$lang['userurl'] = 'Relativní URL pro získání uživatelských informací z API (musí vracet JSON data autentizovaného uživatele)';
$lang['authmethod'] = 'Autorizační metoda pro získání uživatelských informací z API';
$lang['scopes'] = 'Scopes to request (comma separated)';
$lang['scopes'] = 'Požadovaná oprávnění (scopes, oddělená čárkou)';
$lang['needs-state'] = 'Poskytovatel potřebuje a poskytuje parametr pro přesměrování na callback URL';
$lang['json-user'] = 'Objektová cesta k uživatelskému jménu (tečková notace)';
$lang['json-name'] = 'Objektová cesta k celému jménu uživatele (tečkovánotace)';
......
......@@ -12,6 +12,7 @@ $lang['tokenurl'] = 'URL to the token endpoint';
$lang['userurl'] = 'URL to the user info API endpoint (must return JSON about the authenticated user)';
$lang['authmethod'] = 'Authorization method used when talking to the user API';
$lang['scopes'] = 'Scopes to request (comma separated)';
$lang['needs-state'] = 'The provider needs and supplies a state parameter in the callback URL.';
$lang['json-user'] = 'Access to the username in dot notation';
$lang['json-name'] = 'Access to the full name in dot notation';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment