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.
- For Red Hat® OpenShift® Container Platform version 4.4, see Configuring the web console in OpenShift Container Platform
.
- For Red Hat® OpenShift® Container Platform version 4.3, see Configuring the web console in OpenShift Container Platform
.
Complete these steps to add a logout redirect URL:
Update the Console resource
Complete these steps to add a logout redirect URL in the Console
resource:
-
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 ~]
-
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 ~]
-
Add the redirect URLs in the OpenShift console resource.
- Open the resource for editing.
Following is a sample content of theoc edit console cluster
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
- 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
- Open the resource for editing.
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.