GitHub or GitHub Enterprise
After your Red Hat OpenShift Service on AWS 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.
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.
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. |
||
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.
|
The following parameters are common to all identity providers:
Parameter | Description |
---|---|
|
The provider name is prefixed to provider user names to form an identity name. |
|
Defines how new identities are mapped to users when they log in. Enter one of the following values:
|
When adding or changing identity providers, you can map identities from the new
provider to existing users by setting the mappingMethod parameter to
add .
|
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.
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. |
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.
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.
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.
https://oauth-openshift.apps.<cluster_name>.<cluster_domain>/oauth2callback/<idp_provider_name>
For example:
https://oauth-openshift.apps.openshift-cluster.example.com/oauth2callback/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.
The configured identity provider is now visible on the Access control tab of the Cluster List page.
Configure a GitLab identity provider to use GitLab.com or any other GitLab instance as an identity provider.
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.
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.
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.
https://oauth-openshift.apps.<cluster_name>.<cluster_domain>/oauth2callback/<idp_provider_name>
For example:
https://oauth-openshift.apps.openshift-cluster.example.com/oauth2callback/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.
The configured identity provider is now visible on the Access control tab of the Cluster List page.
Configure a Google identity provider to allow users to authenticate with their Google credentials.
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
|
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.
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.
https://oauth-openshift.apps.<cluster_name>.<cluster_domain>/oauth2callback/<idp_provider_name>
For example:
https://oauth-openshift.apps.openshift-cluster.example.com/oauth2callback/google
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.
The configured identity provider is now visible on the Access control tab of the Cluster List page.
Configure the LDAP identity provider to validate user names and passwords against an LDAPv3 server, using simple bind authentication.
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:
ldap://host:port/basedn?attribute?scope?filter
URL component | Description |
---|---|
|
For regular LDAP, use the string |
|
The name and port of the LDAP server. Defaults to
|
|
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. |
|
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 |
|
The scope of the search. Can be either |
|
A valid LDAP search filter. If not provided, defaults to
|
When doing searches, the attribute, filter, and provided user name are combined to create a search filter that looks like:
(&(<filter>)(<attribute>=<username>))
If the LDAP directory requires authentication to search, specify a bindDN and
bindPassword to use to perform the entry search.
|
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.
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.
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.
The configured identity provider is now visible on the Access control tab of the Cluster List page.
Configure an OpenID identity provider to integrate with an OpenID Connect identity provider using an Authorization Code Flow.
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 |
---|---|
|
The preferred user name when provisioning a user. A
shorthand name that the user wants to be referred to as, such as |
|
Email address. |
|
Display name. |
See the OpenID claims documentation for more information.
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.
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.
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.
https://oauth-openshift.apps.<cluster_name>.<cluster_domain>/oauth2callback/<idp_provider_name>
For example:
https://oauth-openshift.apps.openshift-cluster.example.com/oauth2callback/openid
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.
The configured identity provider is now visible on the Access control tab of the Cluster List page.
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.
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. |
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.
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 Add user to grant the administration privileges to the user.
The configured htpasswd identity provider is visible on the Access control → Identity providers page.
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.