Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-8927

Simplify login in to the OCP cluster from the Gateway plugin

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Today, to connect to a DevWorkspace from a local JetBrains IDE, the user first needs to log in to the OCP cluster in one of two suggested ways:

      • either from their local terminal, with the oc login command
      • or by providing a login token to the Gateway window

      Usually, it requires the user to switch to the OCP Console to get a new token. The token expires regularly, which results in repeated user interactions.

       

      This process is a bit cumbersome, and it can be automated in the following way:

      1. The Gateway plugin runs the command 

      oc login [OCP API server URL] --web

      where the OCP API server URL is something like https://api.rm2.thpm.p1.openshiftapps.com:6443/

      This command starts a local HTTP callback server to perform the OAuth2 Authorization Code Grant.

       

      2. The browser automatically opens the OCP login page, e.g.:

       
      3. Once logged in, the browser shows the page like the one below:

       

      4. The plugin has received the OCP token.

       

        1. image-2025-06-12-21-15-33-628.png
          49 kB
          Artem Zatsarynnyi
        2. image-2025-06-12-21-21-01-702.png
          48 kB
          Artem Zatsarynnyi

              vrubezhn@redhat.com Victor Rubezhny
              azatsary Artem Zatsarynnyi
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: