Chapter 8. Configuring identity providers for STS After your Red Hat OpenShift Service on AWS (ROSA) cluster is created, you must configure identity providers to determine how users log in to access the cluster. The following topics describe how to configure an identity provider using OpenShift Cluster Manager console. Alternatively, you can use the ROSA CLI ( rosa ) to configure an identity provider and access the cluster. 8.1. Understanding identity providers Red Hat OpenShift Service on AWS includes a built-in OAuth server. Developers and administrators obtain OAuth access tokens to authenticate themselves to the API. As an administrator, you can configure OAuth to specify an identity provider after you install your cluster. Configuring identity providers allows users to log in and access the cluster. 8.1.1. Supported identity providers You can configure the following types of identity providers: Identity provider Description GitHub or GitHub Enterprise Configure a GitHub identity provider to validate usernames and passwords against GitHub or GitHub Enterprise's OAuth authentication server. GitLab Configure a GitLab identity provider to use GitLab.com or any other GitLab instance as an identity provider. Google Configure a Google identity provider using Google's OpenID Connect integration . LDAP Configure an LDAP identity provider to validate usernames and passwords against an LDAPv3 server, using simple bind authentication. OpenID Connect Configure an OpenID Connect (OIDC) identity provider to integrate with an OIDC identity provider using an Authorization Code Flow . htpasswd Configure an htpasswd identity provider for a single, static administration user. You can log in to the cluster as the user to troubleshoot issues. Important The htpasswd identity provider option is included only to enable the creation of a single, static administration user. htpasswd is not supported as a general-use identity provider for Red Hat OpenShift Service on AWS. For the steps to configure the single user, see Configuring an htpasswd identity provider . 8.1.2. Identity provider parameters The following parameters are common to all identity providers: Parameter Description name The provider name is prefixed to provider user names to form an identity name. mappingMethod Defines how new identities are mapped to users when they log in. Enter one of the following values: claim The default value. Provisions a user with the identity's preferred user name. Fails if a user with that user name is already mapped to another identity. lookup Looks up an existing identity, user identity mapping, and user, but does not automatically provision users or identities. This allows cluster administrators to set up identities and users manually, or using an external process. Using this method requires you to manually provision users. add Provisions a user with the identity's preferred user name. If a user with that user name already exists, the identity is mapped to the existing user, adding to any existing identity mappings for the user. Required when multiple identity providers are configured that identify the same set of users and map to the same user names. Note When adding or changing identity providers, you can map identities from the new provider to existing users by setting the mappingMethod parameter to add . 8.2. Configuring a GitHub identity provider Configure a GitHub identity provider to validate user names and passwords against GitHub or GitHub Enterprise's OAuth authentication server and access your Red Hat OpenShift Service on AWS cluster. OAuth facilitates a token exchange flow between Red Hat OpenShift Service on AWS and GitHub or GitHub Enterprise. Warning Configuring GitHub authentication allows users to log in to Red Hat OpenShift Service on AWS with their GitHub credentials. To prevent anyone with any GitHub user ID from logging in to your Red Hat OpenShift Service on AWS cluster, you must restrict access to only those in specific GitHub organizations or teams. Prerequisites The OAuth application must be created directly within the GitHub organization settings by the GitHub organization administrator. GitHub organizations or teams are set up in your GitHub account. Procedure From OpenShift Cluster Manager , navigate to the Cluster List page and select the cluster that you need to configure identity providers for. Click the Access control tab. Click Add identity provider . Note You can also click the Add Oauth configuration link in the warning message displayed after cluster creation to configure your identity providers. Select GitHub from the drop-down menu. Enter a unique name for the identity provider. This name cannot be changed later. An OAuth callback URL is automatically generated in the provided field. You will use this to register the GitHub application. For example: Register an application on GitHub . Return to Red Hat OpenShift Service on AWS and select a mapping method from the drop-down menu. Claim is recommended in most cases. Enter the Client ID and Client secret provided by GitHub. Enter a hostname . A hostname must be entered when using a hosted instance of GitHub Enterprise. Optional: You can use a certificate authority (CA) file to validate server certificates for the configured GitHub Enterprise URL. Click Browse to locate and attach a CA file to the identity provider. Select Use organizations or Use teams to restrict access to a particular GitHub organization or a GitHub team. Enter the name of the organization or team you would like to restrict access to. Click Add more to specify multiple organizations or teams that users can be a member of. Click Confirm . Verification The configured identity provider is now visible on the Access control tab of the Cluster List page. 8.3. Configuring a GitLab identity provider Configure a GitLab identity provider to use GitLab.com or any other GitLab instance as an identity provider. Prerequisites If you use GitLab version 7.7.0 to 11.0, you connect using the OAuth integration . If you use GitLab version 11.1 or later, you can use OpenID Connect (OIDC) to connect instead of OAuth. Procedure From OpenShift Cluster Manager , navigate to the Cluster List page and select the cluster that you need to configure identity providers for. Click the Access control tab. Click Add identity provider . Note You can also click the Add Oauth configuration link in the warning message displayed after cluster creation to configure your identity providers. Select GitLab from the drop-down menu. Enter a unique name for the identity provider. This name cannot be changed later. An OAuth callback URL is automatically generated in the provided field. You will provide this URL to GitLab. For example: Add a new application in GitLab . Return to Red Hat OpenShift Service on AWS and select a mapping method from the drop-down menu. Claim is recommended in most cases. Enter the Client ID and Client secret provided by GitLab. Enter the URL of your GitLab provider. Optional: You can use a certificate authority (CA) file to validate server certificates for the configured GitLab URL. Click Browse to locate and attach a CA file to the identity provider. Click Confirm . Verification The configured identity provider is now visible on the Access control tab of the Cluster List page. 8.4. Configuring a Google identity provider Configure a Google identity provider to allow users to authenticate with their Google credentials. Warning Using Google as an identity provider allows any Google user to authenticate to your server. You can limit authentication to members of a specific hosted domain with the hostedDomain configuration attribute. Procedure From OpenShift Cluster Manager , navigate to the Cluster List page and select the cluster that you need to configure identity providers for. Click the Access control tab. Click Add identity provider . Note You can also click the Add Oauth configuration link in the warning message displayed after cluster creation to configure your identity providers. Select Google from the drop-down menu. Enter a unique name for the identity provider. This name cannot be changed later. An OAuth callback URL is automatically generated in the provided field. You will provide this URL to Google. For example: Configure a Google identity provider using Google's OpenID Connect integration . Return to Red Hat OpenShift Service on AWS and select a mapping method from the drop-down menu. Claim is recommended in most cases. Enter the Client ID of a registered Google project and the Client secret issued by Google. Enter a hosted domain to restrict users to a Google Apps domain. Click Confirm . Verification The configured identity provider is now visible on the Access control tab of the Cluster List page. 8.5. Configuring a LDAP identity provider Configure the LDAP identity provider to validate user names and passwords against an LDAPv3 server, using simple bind authentication. Prerequisites When configuring a LDAP identity provider, you will need to enter a configured LDAP URL . The configured URL is an RFC 2255 URL, which specifies the LDAP host and search parameters to use. The syntax of the URL is: URL component Description ldap For regular LDAP, use the string ldap . For secure LDAP (LDAPS), use ldaps instead. host:port The name and port of the LDAP server. Defaults to localhost:389 for ldap and localhost:636 for LDAPS. basedn The DN of the branch of the directory where all searches should start from. At the very least, this must be the top of your directory tree, but it could also specify a subtree in the directory. attribute The attribute to search for. Although RFC 2255 allows a comma-separated list of attributes, only the first attribute will be used, no matter how many are provided. If no attributes are provided, the default is to use uid . It is recommended to choose an attribute that will be unique across all entries in the subtree you will be using. scope The scope of the search. Can be either one or sub . If the scope is not provided, the default is to use a scope of sub . filter A valid LDAP search filter. If not provided, defaults to (objectClass=*) When doing searches, the attribute, filter, and provided user name are combined to create a search filter that looks like: Important If the LDAP directory requires authentication to search, specify a bindDN and bindPassword to use to perform the entry search. Procedure From OpenShift Cluster Manager , navigate to the Cluster List page and select the cluster that you need to configure identity providers for. Click the Access control tab. Click Add identity provider . Note You can also click the Add Oauth configuration link in the warning message displayed after cluster creation to configure your identity providers. Select LDAP from the drop-down menu. Enter a unique name for the identity provider. This name cannot be changed later. Select a mapping method from the drop-down menu. Claim is recommended in most cases. Enter a LDAP URL to specify the LDAP search parameters to use. Optional: Enter a Bind DN and Bind password . Enter the attributes that will map LDAP attributes to identities. Enter an ID attribute whose value should be used as the user ID. Click Add more to add multiple ID attributes. Optional: Enter a Preferred username attribute whose value should be used as the display name. Click Add more to add multiple preferred username attributes. Optional: Enter an Email attribute whose value should be used as the email address. Click Add more to add multiple email attributes. Optional: Click Show advanced Options to add a certificate authority (CA) file to your LDAP identity provider to validate server certificates for the configured URL. Click Browse to locate and attach a CA file to the identity provider. Optional: Under the advanced options, you can choose to make the LDAP provider Insecure . If you select this option, a CA file cannot be used. Important If you are using an insecure LDAP connection (ldap:// or port 389), then you must check the Insecure option in the configuration wizard. Click Confirm . Verification The configured identity provider is now visible on the Access control tab of the Cluster List page. 8.6. Configuring an OpenID identity provider Configure an OpenID identity provider to integrate with an OpenID Connect identity provider using an Authorization Code Flow . Important The Authentication Operator in Red Hat OpenShift Service on AWS requires that the configured OpenID Connect identity provider implements the OpenID Connect Discovery specification. Claims are read from the JWT id_token returned from the OpenID identity provider and, if specified, from the JSON returned by the Issuer URL. At least one claim must be configured to use as the user's identity. You can also indicate which claims to use as the user's preferred user name, display name, and email address. If multiple claims are specified, the first one with a non-empty value is used. The standard claims are: Claim Description preferred_username The preferred user name when provisioning a user. A shorthand name that the user wants to be referred to as, such as janedoe . Typically a value that corresponding to the user's login or username in the authentication system, such as username or email. email Email address. name Display name. See the OpenID claims documentation for more information. Prerequisites Before you configure OpenID Connect, check the installation prerequisites for any Red Hat product or service you want to use with your Red Hat OpenShift Service on AWS cluster. Procedure From OpenShift Cluster Manager , navigate to the Cluster List page and select the cluster that you need to configure identity providers for. Click the Access control tab. Click Add identity provider . Note You can also click the Add Oauth configuration link in the warning message displayed after cluster creation to configure your identity providers. Select OpenID from the drop-down menu. Enter a unique name for the identity provider. This name cannot be changed later. An OAuth callback URL is automatically generated in the provided field. For example: Register a new OpenID Connect client in the OpenID identity provider by following the steps to create an authorization request . Return to Red Hat OpenShift Service on AWS and select a mapping method from the drop-down menu. Claim is recommended in most cases. Enter a Client ID and Client secret provided from OpenID. Enter an Issuer URL . This is the URL that the OpenID provider asserts as the Issuer Identifier. It must use the https scheme with no URL query parameters or fragments. Enter an Email attribute whose value should be used as the email address. Click Add more to add multiple email attributes. Enter a Name attribute whose value should be used as the preferred username. Click Add more to add multiple preferred usernames. Enter a Preferred username attribute whose value should be used as the display name. Click Add more to add multiple display names. Optional: Click Show advanced Options to add a certificate authority (CA) file to your OpenID identity provider. Optional: Under the advanced options, you can add Additional scopes . By default, the OpenID scope is requested. Click Confirm . Verification The configured identity provider is now visible on the Access control tab of the Cluster List page. 8.7. Configuring an htpasswd identity provider Configure an htpasswd identity provider to create a single, static user with cluster administration privileges. You can log in to your cluster as the user to troubleshoot issues. Important The htpasswd identity provider option is included only to enable the creation of a single, static administration user. htpasswd is not supported as a general-use identity provider for Red Hat OpenShift Service on AWS. Procedure From OpenShift Cluster Manager , navigate to the Cluster List page and select your cluster. Select Access control Identity providers . Click Add identity provider . Select HTPasswd from the Identity Provider drop-down menu. Add a unique name in the Name field for the identity provider. Use the suggested username and password for the static user, or create your own. Note The credentials defined in this step are not visible after you select Add in the following step. If you lose the credentials, you must recreate the identity provider and define the credentials again. Select Add to create the htpasswd identity provider and the single, static user. Grant the static user permission to manage the cluster: Under Access control Cluster Roles and Access , select Add user . Enter the User ID of the static user that you created in the preceding step. Select a Group . Users in the dedicated-admins group have standard administrative privileges for Red Hat OpenShift Service on AWS. Users in the cluster-admins group have full administrative access to the cluster. Select Add user to grant the administration privileges to the user. Verification The configured htpasswd identity provider is visible on the Access control Identity providers page. Note After creating the identity provider, synchronization usually completes within two minutes. You can log in to the cluster as the user after the htpasswd identity provider becomes available. The single, administrative user is visible on the Access control Cluster Roles and Access page. The administration group membership of the user is also displayed. 8.8. Additional resources Accessing a cluster Understanding the ROSA with STS deployment workflow

Commands:
https://oauth-openshift.apps.<cluster_name>.<cluster_domain>/oauth2callback/<idp_provider_name>
https://oauth-openshift.apps.openshift-cluster.example.com/oauth2callback/github
https://oauth-openshift.apps.<cluster_name>.<cluster_domain>/oauth2callback/<idp_provider_name>
https://oauth-openshift.apps.openshift-cluster.example.com/oauth2callback/gitlab
https://oauth-openshift.apps.<cluster_name>.<cluster_domain>/oauth2callback/<idp_provider_name>
https://oauth-openshift.apps.openshift-cluster.example.com/oauth2callback/google
ldap://host:port/basedn?attribute?scope?filter
(&(<filter>)(<attribute>=<username>))
https://oauth-openshift.apps.<cluster_name>.<cluster_domain>/oauth2callback/<idp_provider_name>
https://oauth-openshift.apps.openshift-cluster.example.com/oauth2callback/openid