Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 5. Managing user-owned OAuth access tokens
Users can review their own OAuth access tokens and delete any that are no longer needed.
5.1. Listing user-owned OAuth access tokens Copier lienLien copié sur presse-papiers!
You can list your user-owned OAuth access tokens. Token names are not sensitive and cannot be used to log in.
Procedure
List all user-owned OAuth access tokens:
oc get useroauthaccesstokens
$ oc get useroauthaccesstokens
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME CLIENT NAME CREATED EXPIRES REDIRECT URI SCOPES <token1> openshift-challenging-client 2021-01-11T19:25:35Z 2021-01-12 19:25:35 +0000 UTC https://oauth-openshift.apps.example.com/oauth/token/implicit user:full <token2> openshift-browser-client 2021-01-11T19:27:06Z 2021-01-12 19:27:06 +0000 UTC https://oauth-openshift.apps.example.com/oauth/token/display user:full <token3> console 2021-01-11T19:26:29Z 2021-01-12 19:26:29 +0000 UTC https://console-openshift-console.apps.example.com/auth/callback user:full
NAME CLIENT NAME CREATED EXPIRES REDIRECT URI SCOPES <token1> openshift-challenging-client 2021-01-11T19:25:35Z 2021-01-12 19:25:35 +0000 UTC https://oauth-openshift.apps.example.com/oauth/token/implicit user:full <token2> openshift-browser-client 2021-01-11T19:27:06Z 2021-01-12 19:27:06 +0000 UTC https://oauth-openshift.apps.example.com/oauth/token/display user:full <token3> console 2021-01-11T19:26:29Z 2021-01-12 19:26:29 +0000 UTC https://console-openshift-console.apps.example.com/auth/callback user:full
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List user-owned OAuth access tokens for a particular OAuth client:
oc get useroauthaccesstokens --field-selector=clientName="console"
$ oc get useroauthaccesstokens --field-selector=clientName="console"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME CLIENT NAME CREATED EXPIRES REDIRECT URI SCOPES <token3> console 2021-01-11T19:26:29Z 2021-01-12 19:26:29 +0000 UTC https://console-openshift-console.apps.example.com/auth/callback user:full
NAME CLIENT NAME CREATED EXPIRES REDIRECT URI SCOPES <token3> console 2021-01-11T19:26:29Z 2021-01-12 19:26:29 +0000 UTC https://console-openshift-console.apps.example.com/auth/callback user:full
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.2. Viewing the details of a user-owned OAuth access token Copier lienLien copié sur presse-papiers!
You can view the details of a user-owned OAuth access token.
Procedure
Describe the details of a user-owned OAuth access token:
oc describe useroauthaccesstokens <token_name>
$ oc describe useroauthaccesstokens <token_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The token name, which is the sha256 hash of the token. Token names are not sensitive and cannot be used to log in.
- 2
- The client name, which describes where the token originated from.
- 3
- The value in seconds from the creation time before this token expires.
- 4
- If there is a token inactivity timeout set for the OAuth server, this is the value in seconds from the creation time before this token can no longer be used.
- 5
- The scopes for this token.
- 6
- The user name associated with this token.
5.3. Deleting user-owned OAuth access tokens Copier lienLien copié sur presse-papiers!
The oc logout
command only invalidates the OAuth token for the active session. You can use the following procedure to delete any user-owned OAuth tokens that are no longer needed.
Deleting an OAuth access token logs out the user from all sessions that use the token.
Procedure
Delete the user-owned OAuth access token:
oc delete useroauthaccesstokens <token_name>
$ oc delete useroauthaccesstokens <token_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
useroauthaccesstoken.oauth.openshift.io "<token_name>" deleted
useroauthaccesstoken.oauth.openshift.io "<token_name>" deleted
Copy to Clipboard Copied! Toggle word wrap Toggle overflow