Questo contenuto non è disponibile nella lingua selezionata.
Chapter 6. Using Red Hat Single Sign-On Operator with automation hub
Private automation hub uses Red Hat Single Sign-On for authentication.
The Red Hat Single Sign-On Operator creates and manages resources. Use this Operator to create custom resources to automate Red Hat Single Sign-On administration in Openshift.
- When installing Ansible Automation Platform on Virtual Machines (VMs) the installer can automatically install and configure Red Hat Single Sign-On for use with private automation hub.
- When installing Ansible Automation Platform on Red Hat OpenShift Container Platform you must install Single Sign-On separately.
This chapter describes the process to configure Red Hat Single Sign-On and integrate it with private automation hub when Ansible Automation Platform is installed on OpenShift Container Platform.
Prerequisites
- You have access to Red Hat OpenShift Container Platform using an account with operator installation permissions.
- You have installed the catalog containing the Red Hat Ansible Automation Platform operators.
- You have installed the Red Hat Single Sign-On Operator. To install the Red Hat Single Sign-On Operator, follow the procedure in Installing Red Hat Single Sign-On using a custom resource in the Red Hat Single Sign-On documentation.
6.1. Creating a Keycloak instance Copia collegamentoCollegamento copiato negli appunti!
When the Red Hat Single Sign-On Operator is installed you can create a Keycloak instance for use with Ansible Automation Platform.
From here you provide an external Postgres or one will be created for you.
Procedure
-
Navigate to
. -
Select the
rh-ssoproject. - Select the Red Hat Single Sign-On Operator.
- On the Red Hat Single Sign-On Operator details page select .
- Click .
Click .
The default Keycloak custom resource is as follows:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Click
- When deployment is complete, you can use this credential to login to the administrative console.
-
You can find the credentials for the administrator in the
credential-<custom-resource>(example keycloak) secret in the namespace.
6.2. Creating a Keycloak realm for Ansible Automation Platform Copia collegamentoCollegamento copiato negli appunti!
Create a realm to manage a set of users, credentials, roles, and groups. A user belongs to and logs into a realm. Realms are isolated from one another and can only manage and authenticate the users that they control.
Procedure
-
Navigate to
. - Select the Red Hat Single Sign-On Operator project.
- Select the Keycloak Realm tab and click .
On the Keycloak Realm form, select . Edit the YAML file as follows:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Expand Field
Description
metadata.nameSet a unique value in metadata for the name of the configuration resource (CR).
metadata.namespaceSet a unique value in metadata for the name of the configuration resource (CR).
metadata.labels.appSet labels to a unique value. This is used when creating the client CR.
metadata.labels.realmSet labels to a unique value. This is used when creating the client CR.
spec.realm.idSet the realm name and id. These must be the same.
spec.realm.realmSet the realm name and id. These must be the same.
spec.realm.displaynameSet the name to display.
- Click and wait for the process to complete.
6.3. Creating a Keycloak client Copia collegamentoCollegamento copiato negli appunti!
Keycloak clients authenticate hub users with Red Hat Single Sign-On. When a user authenticates the request goes through the Keycloak client. When Single Sign-On validates or issues the OAuth token, the client provides the resonse to automation hub and the user can log in.
Procedure
-
Navigate to
. - Select the Red Hat Single Sign-On Operator project.
- Select the Keycloak Client tab and click .
- On the Keycloak Realm form, select .
Replace the default YAML file with the following:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Replace this with a unique value.
- Click and wait for the process to complete.
When automation hub is deployed, you must update the client with the “Valid Redirect URIs” and “Web Origins” as described in Updating the Red Hat Single Sign-On client Additionally, the client comes pre-configured with token mappers, however, if your authentication provider does not provide group data to Red Hat SSO, then the group mapping must be updated to reflect how that information is passed. This is commonly by user attribute.
6.4. Creating a Keycloak user Copia collegamentoCollegamento copiato negli appunti!
This procedure creates a Keycloak user, with the hubadmin role, that can log in to automation hub with Super Administration privileges.
Procedure
-
Navigate to
. - Select the Red Hat Single Sign-On Operator project.
- Select the Keycloak Realm tab and click .
- On the Keycloak User form, select .
Replace the default YAML file with the following:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Click and wait for the process to complete.
When a user is created, the Operator creates a Secret containing both the username and password using the following naming pattern: credential-<realm name>-<username>-<namespace>. In this example the credential is called credential-ansible-automation-platform-hub-admin-rh-sso. When a user is created the Operator does not update the user’s password. Password changes are not reflected in the Secret.
6.5. Installing the Ansible Automation Platform Operator Copia collegamentoCollegamento copiato negli appunti!
Procedure
-
Navigate to
and search for the Ansible Automation Platform Operator. - Select the Ansible Automation Platform Operator project.
- Click on the Operator tile.
- Click .
Select a Project to install the Operator into. Red Hat recommends using the Operator recommended Namespace name.
- If you want to install the Operator into a project other than the recommended one, select Create Project from the drop down menu.
- Enter the Project name.
- Click .
- Click .
- When the Operator has been installed, click .
6.6. Creating a Red Hat Single Sign-On connection secret Copia collegamentoCollegamento copiato negli appunti!
Procedure
-
Navigate to
https://<sso_host>/auth/realms/ansible-automation-platform. -
Copy the
public_keyvalue. -
In the OpenShift Web UI, navigate to
. - Select the ansible-automation-platform project.
- Click , and select .
Edit the following YAML to create the secret
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- This name is used in the next step when creating the automation hub instance.
- 2
- If the secret was changed when creating the Keycloak client for automation hub be sure to change this value to match.
- 3
- Enter the value of the
public_keycopied in Installing the Ansible Automation Platform Operator.
- Click and wait for the process to complete.
6.7. Installing automation hub using the Operator Copia collegamentoCollegamento copiato negli appunti!
Use the following procedure to install automation hub using the operator.
Procedure
-
Navigate to
. - Select the Ansible Automation Platform.
- Select the Automation hub tab and click .
Select . The YAML should be similar to:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Set metadata.name to the name to use for the instance.
- 2
- Set spec.sso_secret to the name of the secret created in Creating a Secret to hold the Red Hat Single Sign On connection details.
NoteThis YAML turns off SSL verification (
ssl_verify: false). If you are not using self-signed certificates for OpenShift this setting can be removed.- Click and wait for the process to complete.
6.8. Determining the automation hub Route Copia collegamentoCollegamento copiato negli appunti!
Use the following procedure to determine the hub route.
Procedure
-
Navigate to
. - Select the project you used for the install.
-
Copy the location of the
private-ah-web-svcservice. The name of the service is different if you used a different name when creating the automation hub instance. This is used later to update the Red Hat Single Sign-On client.
6.9. Updating the Red Hat Single Sign-On client Copia collegamentoCollegamento copiato negli appunti!
When automation hub is installed and you know the URL of the instance, you must update the Red Hat Single Sign-On to set the Valid Redirect URIs and Web Origins settings.
Procedure
-
Navigate to
. - Select the RH-SSO project.
- Click .
- Select .
- Click on the automation-hub-client-secret client.
- Select .
Update the Client YAML to add the Valid Redirect URIs and Web Origins settings.
redirectUris: - 'https://private-ah-ansible-automation-platform.apps-crc.testing/*' webOrigins: - 'https://private-ah-ansible-automation-platform.apps-crc.testing'
redirectUris: - 'https://private-ah-ansible-automation-platform.apps-crc.testing/*' webOrigins: - 'https://private-ah-ansible-automation-platform.apps-crc.testing'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Expand Field
Description
redirectURIsThis is the location determined in Determine Automation Hub Route. Be sure to add the /* to the end of the
redirectUrissetting.webOriginsThis is the location determined in Determine Automation Hub Route.
NoteEnsure the indentation is correct when entering these settings.
- Click .
To verify connectivity
- Navigate to the automation hub route.
-
Enter the
hub_adminuser credentials and sign in. - Red Hat Single Sign-On processes the authentication and redirects back to automation hub.
6.10. Additional resources Copia collegamentoCollegamento copiato negli appunti!
- For more information on running operators on OpenShift Container Platform, see Working with Operators in OpenShift Container Platform in the OpenShift Container Platform product documentation.