How to setup GitHub IdP for OpenShift Container Platform?

Abhishek Veeramalla
1 min readMar 1, 2022

Step 1: Register a new OAuth application

Go to your GitHub Organisation -> Settings -> Developer Settings -> OAuth Apps -> Register a new OAuth application.

Provide the required details

  1. Application Name: <myopenshiftinstall>
  2. Homepage URL: you can get the homepage url by executing the command
    “oc get routes oauth-openshift -n openshift-authentication”
  3. Authorization Callback URL: <Homepage URL>/oauth2callback/<idp-providername>, in this case it can be derived as
    “<Homepage URL>/oauth2callback/githubidp”

4. Register the application.

Create a secret on your cluster to store the OAuth Client ID and Secret

“oc create secret generic <github-secret> — from-literal=clientsecret=<secretfromgithub> -n openshift-config”

Update the OpenShift OAuth resource by providing GitHub OAuthClient details

kind: OAuth
name: cluster
— name: githubidp
mappingMethod: claim
type: GitHub
clientID: <you can get this from github oauth app you created>
name: github-secret
— <your-org-name-in-github>

Refresh your browser or open a new one and login back to your OpenShift Console.