Home > Workload Solutions > Container Platforms > Red Hat OpenShift Container Platform > Archive > Deployment Guide--Dell Ready Stack for Red Hat OpenShift Container Platform 4.3 CSI Attached Storage > Configuring authentication
OpenShift supports different authentication methods based on the Identity provider. For more information about supported authentication providers, see Understanding authentication in the OpenShift Container Platform documentation.
This section describes how to configure identity providers by using htpasswd.
Create an admin user as follows. Unless otherwise specified, run the commands in this section on the CSAH node as user core.
[core@csah ~]$ cd /home/core/openshift
[core@csah openshift]$ htpasswd -c -B -b htpasswd ocpadmin Password1
[core@csah openshift]$ htpasswd -b htpasswd ocpuser Password2
[core@csah openshift]$ oc create secret generic htpass-secret --from-file=htpasswd=/home/core/openshift/htpasswd -n openshift-config
apiVersion: config.openshift.io/v1
kind: OAuth
metadata:
name: cluster
spec:
identityProviders:
- name: htpasswd
mappingMethod: claim
type: HTPasswd
htpasswd:
fileData:
name: htpass-secret
[core@csah ~]$ oc apply -f <file name>
[core@csah ~]$ oc login -u <username>
Authentication required for https://api.ocp.example.lab:6443 (openshift)
Username: <username>
Password: <password>
Login successful.
You don't have any projects. You can try to create a new project, by running oc new-project <projectname>
To assign a cluster-admin role to the admin user:
[core@csah openshift]$ oc login -u kubeadmin -p xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
Login successful.
You have access to 53 projects, the list has been suppressed. You can list all projects with 'oc projects'
Using project "default".
[core@csah ~]$ oc get users
NAME UID FULL NAME IDENTITIES
ocpadmin 273ccf25-9b32-4b4d-aad4-503c5aa27eee htpasswd:ocpadmin
oc get clusterrole --all-namespaces
[core@csah ~]$ oc adm policy add-cluster-role-to-user cluster-admin ocpadmin
clusterrole.rbac.authorization.k8s.io/cluster-admin added: "ocpadmin"