Configuring the OAuth server for a hosted cluster by using the web console
You can configure the internal OAuth server for your hosted cluster by using the Red Hat OpenShift Container Platform web console.
You can configure OAuth for the following supported identity providers:
-
oidc -
htpasswd -
keystone -
ldap -
basic-authentication -
request-header -
github -
gitlab -
google
Adding any identity provider in the OAuth configuration removes the default kubeadmin user provider.
|
|
When you configure identity providers, you must configure at least one |
-
You logged in as a user with
cluster-adminprivileges. -
You created your hosted cluster.
-
Go to Home → API Explorer.
-
Use the Filter by kind box to search for your
HostedClusterresource. -
Click the
HostedClusterresource that you want to edit. -
Click the Instances tab.
-
Click the Options menu
next to your hosted cluster name entry and click Edit HostedCluster.
-
Add the OAuth configuration in the YAML file:
apiVersion: hypershift.openshift.io/v1alpha1 kind: HostedCluster metadata: #... spec: configuration: oauth: identityProviders: - openID: claims: email: - <email_address> name: - <display_name> preferredUsername: - <preferred_username> clientID: <client_id> clientSecret: name: <client_id_secret_name> issuer: https://example.com/identity mappingMethod: lookup name: IAM type: OpenID-
spec.configuration.oauth.identityProviders.openIDspecifies the provider name that is prefixed to the value of the identity claim to form an identity name. The provider name is also used to build the redirect URL. -
spec.configuration.oauth.identityProviders.openID.claims.emaildefines a list of attributes to use as the email address. -
spec.configuration.oauth.identityProviders.openID.claims.namedefines a list of attributes to use as a display name. -
spec.configuration.oauth.identityProviders.openID.claims.preferredUsernamedefines a list of attributes to use as a preferred user name. -
spec.configuration.oauth.identityProviders.openID.clientIDdefines the ID of a client registered with the OpenID provider. You must allow the client to redirect to thehttps://oauth-openshift.apps.<cluster_name>.<cluster_domain>/oauth2callback/<idp_provider_name>URL. -
spec.configuration.oauth.identityProviders.openID.clientSecret.namedefines a secret of a client registered with the OpenID provider. -
spec.configuration.oauth.identityProviders.openID.issuerspecifies the Issuer Identifier described in the OpenID spec. You must usehttpswithout query or fragment component. For more information, see "Issuer Identifier". -
spec.configuration.oauth.identityProviders.mappingMethoddefines a mapping method that controls how mappings are established between identities of this provider andUserobjects.
-
-
Click Save.