Explanation:
Solution:
$ sudo yum install httpd-tools -y
$ htpasswd -c -B -b htpasswd-file-upload armstrong indionce
$ htpasswd -B -b htpasswd-file collins veraster
$ htpasswd -B -b htpasswd-file aldrin roonkere
$ htpasswd -B -b htpasswd-file jobs sestiver
$ htpasswd -B -b htpasswd-file wozniak glegunge
$ oc create secret generic ex280-idp-secret --from-file
htpasswd=htpasswd-file -n openshift-config
$ oc get oauth/cluster -o yaml> oauth.yaml
$ vim oauth.yaml
$
esc--> type :set paste --> enter --> insert --> then paste the content for correct indent pasting
spec:
identityProviders:
- name: ex280-htpasswd mappingMethod: claim type: HTPasswd htpasswd:
fileData:
name: ex280-idp-secret
$ oc replace -f oauth.yaml
$ oc login -u armstrong -p indionce
$ oc login -u collins -p veraster
$ oc login -u aldrin roonkere
$ oc login -u jobs sestiver
$ oc login -u wozniak -p glegunge
#This below part of operation is completely optional and done just for handy login purpose
$ alias _kube='oc login -u kubeadmin -p ${kube_pass} ${api_url}'
$ alias _armstrong='oc login -u armstrong -p ${armstrong}
${api_url}'
$ alias _collins='oc login -u collins -p ${collins} ${api_url}'
$ alias _aldrin='oc login -u aldrin -p ${aldrin} ${api_url}'
$ alias _jobs='oc login -u jobs -p ${jobs} ${api_url}'
$ alias _wozniak='oc login -u wozniak -p ${wozniak} ${api_url}'
$ _armstrong;_armstrong;_collins;_aldrin;_jobs;_wozniak;