Merge pull request #199 from timnolte/feature/disable-refresh-token

Adds Option to Enable/Disable Token Refresh.
isekai
Tim Nolte 5 years ago committed by GitHub
commit 42a7163160
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -457,6 +457,9 @@ class OpenID_Connect_Generic_Client_Wrapper {
* @param $token_response
*/
function save_refresh_token( $manager, $token, $token_response ) {
if ( ! $this->settings->token_refresh_enable ) {
return;
}
$session = $manager->get($token);
$now = current_time( 'timestamp' , true );
$session[$this->cookie_token_refresh_key] = array(

@ -161,6 +161,12 @@ class OpenID_Connect_Generic_Settings_Page {
'type' => 'number',
'section' => 'client_settings',
),
'token_refresh_enable' => array(
'title' => __( 'Enable Refresh Token' ),
'description' => __( 'If checked, support refresh tokens used to obtain access tokens from supported IDPs.' ),
'type' => 'checkbox',
'section' => 'client_settings',
),
'link_existing_users' => array(
'title' => __( 'Link Existing Users' ),
'description' => __( 'If a WordPress account already exists with the same identity as a newly-authenticated user over OpenID Connect, login as that user instead of generating an error.' ),

@ -279,6 +279,7 @@ class OpenID_Connect_Generic {
// plugin settings
'enforce_privacy' => 0,
'alternate_redirect_uri' => 0,
'token_refresh_enable' => 1,
'link_existing_users' => 0,
'create_if_does_not_exist' => 1,
'redirect_user_back' => 0,

Loading…
Cancel
Save