|
| 1 | +# Single Sign On Configurations |
| 2 | + |
| 3 | +> Single sign-on (SSO) is an identification method that enables users to log in to multiple applications and websites with one set of credentials. SSO streamlines the authentication process for users. |
| 4 | +
|
| 5 | + |
| 6 | + |
| 7 | +## Configure CircuitVerse with SAML based SSO using Okta |
| 8 | + |
| 9 | +### Step 1: Configure Okta |
| 10 | + |
| 11 | +This guide provides step-by-step instructions for setting up SAML-based Single Sign-On (SSO) for CircuitVerse using Okta as the Identity Provider (IdP). |
| 12 | + |
| 13 | +1. Log in to your Okta Admin Dashboard. |
| 14 | + |
| 15 | +2. Navigate to "Applications" > "Applications" in the main menu. |
| 16 | + |
| 17 | +  |
| 18 | + |
| 19 | +3. Click on "Create App Integration". |
| 20 | + |
| 21 | +  |
| 22 | + |
| 23 | +4. Select "SAML 2.0" as the Sign-on method and click "Next". |
| 24 | + |
| 25 | +  |
| 26 | + |
| 27 | +5. Fill in the following details for your CircuitVerse app: |
| 28 | + |
| 29 | + * App name: "CircuitVerse" (or your preferred name) |
| 30 | + * App logo: (Optional) Upload CircuitVerse logo |
| 31 | + |
| 32 | +  |
| 33 | + |
| 34 | +6. In the "SAML Settings" section, configure the following: |
| 35 | + |
| 36 | + * Single sign on URL ```https://your-circuitverse-domain.com/users/saml/auth``` |
| 37 | + * Audience URI (SP Entity ID): ```https://your-circuitverse-domain.com/users/saml/metadata``` |
| 38 | + * Name ID format: ```Transient``` |
| 39 | + * Application username: ```Email``` |
| 40 | + |
| 41 | + In the image below, the domain ```https://localhost:3000``` is shown as an example. You should replace it with your own domain. |
| 42 | +  |
| 43 | + |
| 44 | +7. Click "Next" and select "I'm an Okta customer adding an internal app". |
| 45 | + |
| 46 | +  |
| 47 | + |
| 48 | +8. Click "Finish" to create the application. |
| 49 | + |
| 50 | +9. In the "Sign On" tab of your new application, find the "Identity Provider metadata" or "View Setup Instructions" to obtain the following information: |
| 51 | + |
| 52 | + * Identity Provider Single Sign-On URL |
| 53 | + * Identity Provider Issuer |
| 54 | + * Certificate FingerPrint |
| 55 | + |
| 56 | +  |
| 57 | + |
| 58 | +10. You can add users and groups by navigate to Assignment > Assign > Assign to People / Assign to Groups |
| 59 | + |
| 60 | +  |
| 61 | + |
| 62 | +### Step 2: Configure CircuitVerse |
| 63 | + |
| 64 | +1. Create a `.env` file and add the following credentials obtained from configuring Okta: |
| 65 | + * `IDP_SSO_URL=<sso-idp-url>` |
| 66 | + * `IDP_FINGERPRINT=<sso-idp-fingerprint-certificate>` |
| 67 | + |
| 68 | +### Step 3: Enable SSO in CircuitVerse UI |
| 69 | + |
| 70 | +1. Enable the sso_integration feature flag using Flipper (if not already enabled). |
| 71 | +2. Verify that the SSO login option appears on the login page. |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | +### Step 4: Test the Integration |
| 76 | + |
| 77 | +1. Log out of CircuitVerse. |
| 78 | +2. Click on the "Login with SSO" button on the CircuitVerse login page. |
| 79 | +3. You should be redirected to the Okta login page. |
| 80 | +4. Enter your Okta credentials. |
| 81 | +5. After successful authentication, you should be redirected back to CircuitVerse and logged in. |
| 82 | + |
| 83 | +## Configure CircuitVerse with SAML based SSO using Keycloak |
| 84 | + |
| 85 | +This guide provides step-by-step instructions for setting up SAML-based Single Sign-On (SSO) for CircuitVerse using Keycloak as the Identity Provider (IdP). |
| 86 | + |
| 87 | +### Step 1: Configure Keycloak |
| 88 | + |
| 89 | +1. Go to the Keycloak Admin console UI and sign in as an administrator |
| 90 | + |
| 91 | +  |
| 92 | + |
| 93 | +2. Select or create a realm for CircuitVerse. |
| 94 | + |
| 95 | +3. In the left sidebar, click on "Clients" and then click "Create" to add a new client. |
| 96 | + |
| 97 | + * Client ID: CircuitVerse (or your preferred name) |
| 98 | + * Client Type: Select ```SAML``` |
| 99 | + |
| 100 | +  |
| 101 | + |
| 102 | +4. Click "Save" to create the client. |
| 103 | + |
| 104 | +  |
| 105 | + |
| 106 | +5. In the client settings, configure the following: |
| 107 | + |
| 108 | + * Valid Redirect URIs: https://your-circuitverse-domain.com/ |
| 109 | + * Base URL: https://your-circuitverse-domain.com |
| 110 | + * Master SAML Processing URL: https://your-circuitverse-domain.com/users/saml/auth |
| 111 | + |
| 112 | + In the image below, the domain ```https://localhost:3000``` is shown as an example. You should replace it with your own |
| 113 | +  |
| 114 | + |
| 115 | +6. Go to Clients > Client scopes, and select {Yours-realm-name} and add predefined mappers such as ``Email`` |
| 116 | + |
| 117 | +7. Go to Clients > Keys, and turn off the Client signature required option from signing keys config |
| 118 | + |
| 119 | +  |
| 120 | + |
| 121 | +8. Create new user which is to be used for login. Be sure to include email id in username and email fields |
| 122 | + |
| 123 | +  |
| 124 | + |
| 125 | +### Step 2: Extract Keycloak SAML Credentials |
| 126 | + |
| 127 | +To get the required credentials for CircuitVerse (``IDP_SSO_URL`` and ``IDP_FINGERPRINT``), follow these steps: |
| 128 | + |
| 129 | +* Open the downloaded XML file in a text editor. |
| 130 | +* Find the "SingleSignOnService" tag. The "Location" attribute of this tag is your ``IDP_SSO_URL``. |
| 131 | +* From this XML file make note of ``SAML entity id`` and ``SAML X.509 certificate`` |
| 132 | + |
| 133 | +### Step 3: Configure CircuitVerse |
| 134 | + |
| 135 | +1. Create a `.env` file and add the following credentials obtained from configuring Okta: |
| 136 | + * `IDP_SSO_URL=<sso-idp-url>` |
| 137 | + * `IDP_FINGERPRINT=<sso-idp-fingerprint-certificate>` |
| 138 | + |
| 139 | +### Step 4: Enable SSO in CircuitVerse UI |
| 140 | + |
| 141 | +1. Enable the sso_integration feature flag using Flipper (if not already enabled). |
| 142 | +2. Verify that the SSO login option appears on the login page. |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | +### Step 5: Test the Integration |
| 147 | + |
| 148 | +1. Log out of CircuitVerse. |
| 149 | +2. Click on the "Login with SSO" button on the CircuitVerse login page. |
| 150 | +3. You should be redirected to the Keycloak login page. |
| 151 | +4. Enter your KeyCloak credentials. |
| 152 | +5. After successful authentication, you should be redirected back to CircuitVerse and logged in. |
0 commit comments