This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.2.4. Configuring the internal OAuth server’s token duration
You can configure default options for the internal OAuth server’s token duration.
By default, tokens are only valid for 24 hours. Existing sessions expire after this time elapses.
If the default time is insufficient, then this can be modified using the following procedure.
Procedure
Create a configuration file that contains the token duration options. The following file sets this to 48 hours, twice the default.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Set
accessTokenMaxAgeSeconds
to control the lifetime of access tokens. The default lifetime is 24 hours, or 86400 seconds. This attribute cannot be negative. If set to zero, the default lifetime is used.
Apply the new configuration file:
注意Because you update the existing OAuth server, you must use the
oc apply
command to apply the change.oc apply -f </path/to/file.yaml>
$ oc apply -f </path/to/file.yaml>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that the changes are in effect:
oc describe oauth.config.openshift.io/cluster
$ oc describe oauth.config.openshift.io/cluster
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
... Spec: Token Config: Access Token Max Age Seconds: 172800 ...
... Spec: Token Config: Access Token Max Age Seconds: 172800 ...
Copy to Clipboard Copied! Toggle word wrap Toggle overflow