Adding a logout redirect URL

You can add a logout redirect URL that is displayed after you log out of the Red Hat® OpenShift® Container Platform console.

For more information, see Red Hat® OpenShift® Container Platform documentation.

Complete these steps to add a logout redirect URL:

  1. Update the Console resource.
  2. Update the platform-oidc-registration.json file.

Update the Console resource

Complete these steps to add a logout redirect URL in the Console resource:

  1. Get the IBM Cloud Pak foundational services URL.

    oc get route -n <your-foundational-services-namespace> cp-console -o=jsonpath={.spec.host}
    

    Following is a sample output:

    cp-console.apps.hcp.darumtech.net[root@2test-inf ~]
    
  2. Get the Red Hat® OpenShift® Container Platform console URL.

    oc get route -n openshift-console console -o jsonpath={.spec.host}
    

    Following is a sample output:

    console-openshift-console.apps.hcp.darumtech.net[root@2test-inf ~]
    
  3. Add the redirect URLs in the OpenShift console resource.

    1. Open the resource for editing.
      oc edit console cluster
      
      Following is a sample content of the Console resource:
      apiVersion: config.openshift.io/v1
      kind: Console
      metadata:
        annotations:
          release.openshift.io/create-only: "true"
        creationTimestamp: "2020-03-25T15:34:01Z"
        generation: 6
        name: cluster
        resourceVersion: "9119030"
        selfLink: /apis/config.openshift.io/v1/consoles/cluster
        uid: ab896f97-ad65-456e-806b-1f7fbe879345
      spec: {}
      status:
        consoleURL: https://console-openshift-console.apps.hcp.darumtech.net
      
    2. Add the logout redirect URL in the spec section by using the IBM Cloud Pak foundational services URL and the Red Hat® OpenShift® Container Platform console URL values. Following is the syntax of the logout redirect URL:
    https://<{{site.data.keyword.cs}} URL>/idprovider/v1/auth/logout?login_url=https://<{{site.data.keyword.ocp}} console URL>
    

    Following would be the example logout redirect URL:

    https://cp-console.apps.hcp.darumtech.net/idprovider/v1/auth/logout?login_url=https://console-openshift-console.apps.hcp.darumtech.net
    

    You would add this redirect URL as shown in the following piece of code:

    spec:
      authentication:                 <===== Add this section
        logoutRedirect:               <===== Add the logout redirect URL
    

    Following is a sample of the updated Console resource:

      apiVersion: config.openshift.io/v1
      kind: Console
      metadata:
        annotations:
          release.openshift.io/create-only: "true"
        creationTimestamp: "2020-03-25T15:34:01Z"
        generation: 6
        name: cluster
        resourceVersion: "9119030"
        selfLink: /apis/config.openshift.io/v1/consoles/cluster
        uid: ab896f97-ad65-456e-806b-1f7fbe879345
      spec:
        authentication:
          logoutRedirect: https://cp-console.apps.hcp.darumtech.net/idprovider/v1/auth/logout?login_url=https://console-openshift-console.apps.hcp.darumtech.net
      status:
        consoleURL: https://console-openshift-console.apps.hcp.darumtech.net
    

Update the platform-oidc-registration.json file

You must add the Red Hat® OpenShift® Container Platform console URL in the platform-oidc-registration.json in the "redirect_uris" section.