Skip to content

Instantly share code, notes, and snippets.

@dougbtv
Created January 21, 2021 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dougbtv/d2c0d2706853eff696f3d910d3d5857b to your computer and use it in GitHub Desktop.
Save dougbtv/d2c0d2706853eff696f3d910d3d5857b to your computer and use it in GitHub Desktop.
How to setup an average joe user in OpenShift

First, type the Konami code into your terminal, then...

Create a user, then create a password for the user...

oc create user doug
htpasswd -c -B -b /tmp/doughtpass doug s00persecret

Create an ident yaml...

$ cat ident.yml 
apiVersion: config.openshift.io/v1
kind: OAuth
metadata:
  name: cluster
spec:
  identityProviders:
  - name: dougprovider
    mappingMethod: claim 
    type: HTPasswd
    htpasswd:
      fileData:
        name: htpass-secret

$ oc apply -f ident.yml

Then you can login and check that you're logged in as that user...

$ oc login -u doug
$ oc whoami
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment