Configure single sign-on with federated identity
Configure federated authentication so that users can log in to the Dashboard with centralized credentials.
Red Hat supports only Red Hat’s SSO technology as the federated identity provider for RHOSO. If you use another vendor, contact Red Hat Support for a support exception.
Enable SSO login for OpenStack Dashboard Copy linkLink copied!
Deploy Red Hat OpenStack Services on OpenShift (RHOSO) with Red Hat’s single sign-on (SSO) technology to enable users to log in to the OpenStack Dashboard (horizon) with centralized federated credentials.
Before you begin Copy linkLink copied!
- You have installed RHOSO.
- You have a SSO federated solution in your environment.
About this task Copy linkLink copied!
You must modify the Identity service (keystone) configuration to integrate your federated SSO authentication solution. For more information, see Connect the Identity service to SSO to enable federated user authentication.
Procedure Copy linkLink copied!
What to do next Copy linkLink copied!
Connect the Identity service to SSO to enable federated user authentication Copy linkLink copied!
After you deploy Red Hat OpenStack Services on OpenShift (RHOSO) with Red Hat’s single sign-on (SSO) technology, integrate SSO with the Identity service (keystone) to enable federated user authentication and role-based access.
Procedure Copy linkLink copied!
What to do next Copy linkLink copied!
Authenticate federated users in the openstack CLI Copy linkLink copied!
You can authenticate federated users in the openstack CLI after you have enabled logging into the OpenStack Dashboard (horizon) by using Red Hat's single sign-on (SSO) technology and you have connected the Identity service to SSO to enable federated user authentication.
You can use the following command to access the remote shell for the OpenStackClient pod from your workstation to run the required openstack CLI authentication commands: oc rsh openstackclient.
You can use the following methods of authenticating federated users in the openstack CLI:
openstack CLI authentication commands:
--os-project-name "<federated_project_name>" \
--os-project-domain-name "<federated_domain_name>" \
where
<federated_project_name>- Specifies the name of the federated project.
<federated_domain_name>- Specifies the name of the federated domain.
- Authenticate using the Resource Owner Password Credentials Flow: Your federation client must support the Resource Owner Password Credentials Flow and use the settings that you specified when deploying and integrating SSO with RHOSO.
Run the following
openstackCLI command:$ openstack --os-auth-url "https://<keystone_endpoint>/v3" \ --os-identity-api-version 3 \ --os-auth-type v3oidcpassword \ --os-identity-provider "<idp_name>" \ --os-protocol "openid" \ --os-client-id "<client_id>" \ --os-client-secret "<client_secret>" \ --os-discovery-endpoint "https://<sso_fqdn>/realms/<realm>/.well-known/openid-configuration" \ --os-openid-scope "openid email profile" \ --os-access-token-type "access_token" \ --os-username "<idp_username>" \ --os-password "<idp_password>" \ token issuewhere:
<keystone_endpoint>- Specifies the URL that you can retrieve by running the following command:
oc get keystoneapis.keystone.openstack.org -o json | jq '.items[0].status.apiEndpoints.public'. This URL must end in a trailing `/`. -
<idp_name> - Specifies a value of your choosing, for example,
kcipaIdP. -
<client_id> - Specifies the client ID provided by your SSO administrator.
-
<client_secret> - Specifies the client secret provided by your SSO administrator.
-
<sso_fqdn> - Specifies the fully qualified domain name for your SSO identity provider (IdP).
-
<realm> - Specifies the SSO realm name.
-
<idp_username> - Specifies your IdP username.
-
<idp_password> - Specifies your IdP password.
- Authenticate using an access token from your SSO identity provider: This method is useful when the IdP does not allow the Resource Owner Password Credentials Flow, or when you want to use an existing SSO session without passing credentials to the OpenStack CLI.
Important You must receive a valid access token from your SSO identity provider and ifOS_CLOUDis set then depending upon your specificOS_CLOUDparameters you may need to unset this first to avoid conflicts with this authentication.Run the following
openstackCLI command:$ openstack --os-auth-url "https://<keystone_endpoint>/v3" \ --os-identity-api-version 3 \ --os-auth-type v3oidcaccesstoken \ --os-identity-provider "<idp_name>" \ --os-protocol "openid" \ --os-access-token "<access_token_from_idp>" \ token issuewhere:
<access_token_from_idp>- Specifies the valid access token you have obtained from your SSO identity provider.
- Authenticate using the Authorization Code Flow or browser redirect: Your federation client must support the standard OAuth 2.0 Authorization Code Flow, typically used in web applications. This method requires obtaining an authorization code through a browser-based redirect, then exchanging this authorization code for an access token.
Your users must use the following authorization endpoint to obtain the authorization code, which is returned via the specified redirect URI:
Note The redirect URI, in this examplehttps://<keystone_endpoint>/v3/redirect_uri, must be registered with the IdP and must exactly match the value specified in theopenstackcommand.https://<sso_fqdn>/auth/realms/<realm>/protocol/openid-connect/auth?client_id=<client_id>&redirect_uri=https://<keystone_endpoint>/v3/redirect_uri&response_type=code&scope=openid%20profile%20email&state=<random_string>where:
<random_string>- Specifies a unique, cryptographically random string generated by the client application for each authentication attempt.
After the user successfully authenticates, the IdP redirects the authorization code as a query parameter to this redirect URI. You can then run the following
openstackcommand to obtain an access token from this authorization code:$ openstack --os-auth-url "https://<keystone_endpoint>/v3" \ --os-identity-api-version 3 \ --os-auth-type v3oidcauthcode \ --os-identity-provider "<idp_name>" \ --os-protocol "openid" \ --os-client-id "<client_id>" \ --os-client-secret "<client_secret>" \ --os-discovery-endpoint "https://<sso_fqdn>/realms/<realm>/.well-known/openid-configuration" \ --os-openid-scope "openid email profile" \ --os-access-token-type "access_token" \ --os-redirect-uri "https://<keystone_endpoint>/v3/redirect_uri" \ --os-code "<authorization_code>" \ token issuewhere:
<authorization_code>- Specifies the authorization code that is returned to the specified redirect URI.
- Authenticate using the Client Credentials Flow for service accounts: Your federation client must support the Client Credentials Flow that provides service-to-service authentication where no user context is required. In this case the federation client authenticates using its own credentials with its client ID and secret rather than with user credentials.
Note The IdP must haveService Accountsenabled for the federation client to use this flow.Run the following
openstackCLI command:$ openstack --os-auth-url "https://<keystone_endpoint>/v3" \ --os-identity-api-version 3 \ --os-auth-type v3oidcclientcredentials \ --os-identity-provider "<idp_name>" \ --os-protocol "openid" \ --os-client-id "<client_id>" \ --os-client-secret "<client_secret>" \ --os-discovery-endpoint "https://<sso_fqdn>/realms/<realm>/.well-known/openid-configuration" \ token issue