Advertisement
Guest User

Untitled

a guest
May 2nd, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. HTPASSWD_FILE="./htpass"
  4. USERNAME="suraj1"
  5. USERPASS="developer"
  6. HTPASSWD_SECRET="htpasswd-secret1"
  7.  
  8. htpasswd -cb $HTPASSWD_FILE $USERNAME $USERPASS
  9.  
  10. oc get secret $HTPASSWD_SECRET -n openshift-config &> /dev/null
  11.  
  12. oc create secret generic ${HTPASSWD_SECRET} --from-file=htpasswd=${HTPASSWD_FILE} -n openshift-config
  13.  
  14. oc apply -f - <<EOF
  15. apiVersion: config.openshift.io/v1
  16. kind: OAuth
  17. metadata:
  18. name: cluster
  19. spec:
  20. identityProviders:
  21. - name: htpassidp1
  22. challenge: true
  23. login: true
  24. mappingMethod: claim
  25. type: HTPasswd
  26. htpasswd:
  27. fileData:
  28. name: ${HTPASSWD_SECRET}
  29. EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement