Skip to content
Snippets Groups Projects
Commit 51298b29 authored by Pietro Saccardi's avatar Pietro Saccardi
Browse files

Toggle state parm depending on config parm

parent d13c9ae1
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,8 @@ class Generic extends AbstractOAuth2Base ...@@ -12,7 +12,8 @@ class Generic extends AbstractOAuth2Base
{ {
/** @inheritdoc */ /** @inheritdoc */
public function needsStateParameterInAuthUrl() { public function needsStateParameterInAuthUrl() {
return true; $plugin = plugin_load('helper', 'oauthgeneric');
return 0 !== $plugin->getConf('needs-state');
} }
/** @inheritdoc */ /** @inheritdoc */
......
...@@ -11,6 +11,7 @@ $conf['tokenurl'] = ''; ...@@ -11,6 +11,7 @@ $conf['tokenurl'] = '';
$conf['userurl'] = ''; $conf['userurl'] = '';
$conf['authmethod'] = 0; $conf['authmethod'] = 0;
$conf['scopes'] = ''; $conf['scopes'] = '';
$conf['needs-state'] = 0;
$conf['json-user'] = ''; $conf['json-user'] = '';
$conf['json-name'] = ''; $conf['json-name'] = '';
......
...@@ -11,6 +11,7 @@ $meta['tokenurl'] = array('string'); ...@@ -11,6 +11,7 @@ $meta['tokenurl'] = array('string');
$meta['userurl'] = array('string'); $meta['userurl'] = array('string');
$meta['authmethod'] = array('multichoice', '_choices' => [0, 1, 6, 2, 3, 4, 5]); $meta['authmethod'] = array('multichoice', '_choices' => [0, 1, 6, 2, 3, 4, 5]);
$meta['scopes'] = array('array'); $meta['scopes'] = array('array');
$meta['needs-state'] = array('onoff');
$meta['json-user'] = array('string'); $meta['json-user'] = array('string');
$meta['json-name'] = array('string'); $meta['json-name'] = array('string');
......
...@@ -11,8 +11,8 @@ $lang['authurl'] = 'URL pro autentizaci'; ...@@ -11,8 +11,8 @@ $lang['authurl'] = 'URL pro autentizaci';
$lang['tokenurl'] = 'URL pro získání tokenu'; $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['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['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['scopes'] = 'Požadovaná oprávnění (scopes, oddělená čárkou)';
$lang['needs-state'] = 'Whether the provider needs and supplies a state parameter in the callback URL.';
$lang['json-user'] = 'Objektová cesta k uživatelskému jménu (tečková notace)'; $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)'; $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'; ...@@ -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['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['authmethod'] = 'Authorization method used when talking to the user API';
$lang['scopes'] = 'Scopes to request (comma separated)'; $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-user'] = 'Access to the username in dot notation';
$lang['json-name'] = 'Access to the full name 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