Skip to content

Configuration of token lifetimes #131

@TomTHKim

Description

@TomTHKim

Thanks all for this plugin. I appreciate the work put into it.

For my use case, it would be useful to be able to configure the lifetimes of the access/ID tokens. This currently uses the default values from oauth2-server-php (3600s) and I don't see a way to change these in OpenID Connect Server (please correct me if I am wrong). Could we add a way to configure this?

Perhaps the fastest way to allow configuration of the OAuth server would be to add a configuration filter here:

$config = array(
'use_jwt_access_tokens' => true,
'use_openid_connect' => true,
'issuer' => home_url( '/' ),
);
$server = new Server( new AuthorizationCodeStorage(), $config );

Something like:

    $config = apply_filters( 'oidc_server_config', array() );

    // Enforce required values
    $config['use_openid_connect']    = true;
    $config['use_jwt_access_tokens'] = true;
    $config['issuer']                = home_url( '/' );

    $server = new Server( new AuthorizationCodeStorage(), $config );

This allows most of the configuration values to be set whilst ensuring the required values are maintained.

Thanks for taking the time to read this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions