User OAuth tokens in OpenShift 4

Solution Verified - Updated -

Issue

  • How to change / delete the user token for connecting to an OpenShift 4 cluster?
  • User token is not changed after deleting the useroauthaccesstoken related object.
  • Command oc whoami --show-token and command oc get UserOAuthAccessToken shows different token.
  • When doing an oc logout, the token from the OpenShift web console used is no longer valid, even if the expiration was not yet passed.
  • Invalid token error after using oc logout command:

    error: The token provided is invalid or expired.
    

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4
  • OAuth
  • oc CLI

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content