You can add a logout redirect URL that is displayed after you log out of the OpenShift Container Platform console.
For more information, see OpenShift Container Platform documentation.
Complete these steps to add a logout redirect URL:
Complete these steps to add a logout redirect URL in the Console resource:
Get the IBM Cloud Platform Common Services URL.
oc get route -n ibm-common-services cp-console -o=jsonpath={.spec.host}
Following is a sample output:
cp-console.apps.hcp.darumtech.net[root@2test-inf ~]
Get the 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.
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
Add the logout redirect URL in the spec section by using the IBM Cloud Platform Common Services URL and the OpenShift Container Platform console URL values. Following is the syntax of the logout redirect URL:
https://<IBM Cloud Platform Common Services URL>/idprovider/v1/auth/logout?login_url=https://<OpenShift Container Platform console URL>
Following would be the example logout redirect URL:
https://icp-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://icp-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
You must add the OpenShift Container Platform console URL in the platform-oidc-registration.json in the "redirect_uris" section.
For more information, see Customizing the cluster access URL.