|
| 1 | +Single Sign-On (SSO) is an authentication scheme, allowing users to log-in with a single pair of credentials to multiple, independent software systems. |
| 2 | + |
| 3 | +This article explains the procedure to configure single sign-on to Run:ai using the OpenID Connect protocol in OpenShift V4. |
| 4 | + |
| 5 | +## **Prerequisites** |
| 6 | + |
| 7 | +Before starting, make sure you have the following available from your OpenShift cluster: |
| 8 | + |
| 9 | +* OpenShift OAuth client \- see [Registering an additional OAuth client](https://docs.openshift.com/container-platform/4.16/authentication/configuring-oauth-clients.html\#oauth-register-additional-client\_configuring-oauth-clients) |
| 10 | + * ClientID \- the ID used to identify the client with the Authorization Server. |
| 11 | + * Client Secret \- a secret password that only the Client and Authorization Server know. |
| 12 | +* Base URL \- the OpenShift API Server endpoint (example: [https://api.\<cluster-url\>:6443](https://api.noa-ocp.runailabs.com:6443/)) |
| 13 | + |
| 14 | +## **Setup** |
| 15 | + |
| 16 | +Follow the steps below to setup SSO with OpenShift. |
| 17 | + |
| 18 | +### **Adding the identity provider** |
| 19 | + |
| 20 | +1. Go to **Tools & Settings** → **General** |
| 21 | +1. Open the Security section and click **\+IDENTITY PROVIDER** |
| 22 | +1. Select **OpenShift V4** |
| 23 | +1. Enter the **Base URL**, Client ID, and **Client Secret** from your OpenShift OAuth client. |
| 24 | +1. Copy the Redirect URL to be used in your OpenShift OAuth client |
| 25 | +1. Optional: Enter the user attributes and their value in the identity provider (see the user attributes table below) |
| 26 | +1. Click **SAVE** |
| 27 | + User attributes |
| 28 | + |
| 29 | +| Attribute | Default value in Run:ai | Description | |
| 30 | +| :---- | :---- | :---- | |
| 31 | +| User role groups | GROUPS | If it exists in the IDP, it allows you to assign Run:ai role groups via the IDP. The IDP attribute must be a list of strings. | |
| 32 | +| Linux User ID | UID | If it exists in the IDP, it allows Researcher containers to start with the Linux User UID. Used to map access to network resources such as file systems to users. The IDP attribute must be of type integer. | |
| 33 | +| Linux Group ID | GID | If it exists in the IDP, it allows Researcher containers to start with the Linux Group GID. The IDP attribute must be of type integer. | |
| 34 | +| Supplementary Groups | SUPPLEMENTARYGROUPS | If it exists in the IDP, it allows Researcher containers to start with the relevant Linux supplementary groups. The IDP attribute must be a list of integers. | |
| 35 | +| Email | email | Defines the user attribute in the IDP holding the user's email address, which is the user identifier in Run:ai | |
| 36 | +| User first name | firstName | Used as the user’s first name appearing in the Run:ai user interface | |
| 37 | +| User last name | lastName | Used as the user’s last name appearing in the Run:ai user interface | |
| 38 | + |
| 39 | +### **Testing the setup** |
| 40 | + |
| 41 | +1. Open the Run:ai platform as an admin |
| 42 | +1. Add Access Rules to an SSO user defined in the IDP |
| 43 | +1. Open the Run:ai platform in an incognito browser tab |
| 44 | +1. On the sign-in page click **CONTINUE WITH SSO.** You are redirected to the OpenShift IDP sign-in page |
| 45 | +1. In the identity provider sign-in page, log-in with the SSO user who you granted with access rules. |
| 46 | +1. If you are unsuccessful signing-in to the identity provider, follow the Troubleshooting section below |
| 47 | + |
| 48 | +### **Troubleshooting** |
| 49 | + |
| 50 | +If testing the setup was unsuccessful, try the different troubleshooting scenarios according to the error you received. |
| 51 | + |
| 52 | +#### **Troubleshooting scenarios** |
| 53 | + |
| 54 | +**Error:** “403 \- Sorry, we can’t let you see this page. Something about permissions…” |
| 55 | + |
| 56 | + |
| 57 | +**Description:** The authenticated user is missing permissions |
| 58 | +**Mitigation**: |
| 59 | +- Validate either the user or its related group/s are assigned with access rules. |
| 60 | +- Validate groups attribute is available in the configured OIDC Scopes |
| 61 | +- Validate the user’s groups attribute is mapped correctly |
| 62 | +**Advanced:** |
| 63 | +- Open the Chrome DevTools: Right-click on page → Inspect → Console tab |
| 64 | +- Run the following command to retrieve the user’s token: `localStorage.token;` |
| 65 | +- Paste in [https://jwt.io](https://jwt.io/) |
| 66 | +- Under the Payload section validate the value of the user’s attributes |
| 67 | + |
| 68 | +**Error:** “We’re having trouble identifying your account because your email is incorrect or can’t be found.” |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +**Description:** Authentication failed because email attribute was not found. |
| 73 | +**Mitigation**: |
| 74 | +- Validate email attribute is available in the configured OIDC Scopes |
| 75 | +- Validate the user’s email attribute is mapped correctly |
| 76 | + |
| 77 | +**Error:** “Unexpected error when authenticating with identity provider” |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | +**Description:** User authentication failed |
| 82 | +**Mitigation**: |
| 83 | +Validate the configured OIDC Scopes exist and match the Identity Provider’s available scopes |
| 84 | +**Advanced:** |
| 85 | +Look for the specific error message in the URL address |
| 86 | + |
| 87 | + |
| 88 | +**Error:** “Unexpected error when authenticating with identity provider” (SSO sign-in is not available) |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | +**Description:** User authentication failed |
| 93 | +**Mitigation**: |
| 94 | +- Validate the configured OIDC scope exists in the Identity Provider |
| 95 | +- Validate the configured Client Secret match the Client Secret value in the OAuthclient Kubernetes object. |
| 96 | +**Advanced:** |
| 97 | +Look for the specific error message in the URL address |
| 98 | + |
| 99 | +**Error:** “Client not found” |
| 100 | + <!-- TBD \- OpenShift screenshot --> |
| 101 | +**Description:** OIDC Client ID was not found in the OpenShift IDP |
| 102 | +**Mitigation**: |
| 103 | +Validate the configured Client ID matches the value in the OAuthclient Kubernetes object. |
| 104 | + |
| 105 | +### **Editing the identity provider** |
| 106 | + |
| 107 | +You can view the identity provider details and edit its configuration: |
| 108 | + |
| 109 | +1. Go to **Tools & Settings** → **General** |
| 110 | +1. Open the Security section |
| 111 | +1. On the identity provider box, click **Edit identity provider** |
| 112 | +1. You can edit either the **Base URL**, **Client ID**, **Client Secret**, or the **User attributes** |
| 113 | + |
| 114 | +### **Removing the identity provider** |
| 115 | + |
| 116 | +You can remove the identity provider configuration: |
| 117 | + |
| 118 | +1. Go to **Tools & Settings** → **General** |
| 119 | +1. Open the Security section |
| 120 | +1. On the identity provider card, click **Remove identity provider** |
| 121 | +1. In the dialog, click **REMOVE** to confirm the action |
| 122 | + |
| 123 | +!!!Note |
| 124 | + To avoid losing access, removing the identity provider must be carried out by a local user. |
| 125 | + |
0 commit comments