How to setup GitHub IdP for OpenShift Container Platform?
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
- Application Name: <myopenshiftinstall>
- Homepage URL: you can get the homepage url by executing the command
“oc get routes oauth-openshift -n openshift-authentication” - 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
apiVersion: config.openshift.io/v1
kind: OAuth
metadata:
name: cluster
spec:
identityProviders:
— name: githubidp
mappingMethod: claim
type: GitHub
github:
clientID: <you can get this from github oauth app you created>
clientSecret:
name: github-secret
organizations:
— <your-org-name-in-github>
Refresh your browser or open a new one and login back to your OpenShift Console.