Skip to content

Commit e472ff3

Browse files
authored
feat: add documentation for how to configure Circuitverse with SAML using Okta and keycloak (#380)
1 parent de58300 commit e472ff3

19 files changed

Lines changed: 153 additions & 0 deletions

docs/_sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* [Getting Started with CircuitVerse](/chapter2/1gettingstarted.md)
88
* [CircuitVerse For Educators](/chapter2/2cvforeducators.md)
99
* [Integrate CircuitVerse with LMS](/chapter2/3lmsintegration.md)
10+
* [Single Sign On Configurations](/chapter2/5ssointegration.md)
1011
* [Best Practices For Working With CircuitVerse Simulator](/chapter2/4bestpracticescv.md)
1112
* Chapter 3: Simulator Interface
1213
* [Introduction](/chapter3/1introduction.md)

docs/chapter2/5ssointegration.md

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
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+
![About SSO Integration](../images/img_chapter2/sso_integration/about_sso.png)
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+
![Navigate to "Applications" > "Applications" in the main menu.](../images/img_chapter2/sso_integration/navigate_to_applicattion.png)
18+
19+
3. Click on "Create App Integration".
20+
21+
![Click on "Create App Integration.](../images/img_chapter2/sso_integration/create_app_integration.png)
22+
23+
4. Select "SAML 2.0" as the Sign-on method and click "Next".
24+
25+
![Select "SAML 2.0" as the Sign-on method and click "Next"..](../images/img_chapter2/sso_integration/step_4_select_saml2.0.png)
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+
![add name and logo](../images/img_chapter2/sso_integration/step5.png)
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+
![SAML Settings](../images/img_chapter2/sso_integration/step6.png)
43+
44+
7. Click "Next" and select "I'm an Okta customer adding an internal app".
45+
46+
![Click "Next" and select "I'm an Okta customer adding an internal app"](../images/img_chapter2/sso_integration/step7.png)
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+
![Credentials](../images/img_chapter2/sso_integration/credentials.png)
57+
58+
10. You can add users and groups by navigate to Assignment > Assign > Assign to People / Assign to Groups
59+
60+
![Assign people/Groups](../images/img_chapter2/sso_integration/Assign.png)
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+
![Single Sign On Button](../images/img_chapter2/sso_integration/SingleSignOnButton.png)
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+
![Keycloak Admin console](../images/img_chapter2/sso_integration/admin-login-keycloak.webp)
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+
![create a realm for CircuitVerse.](../images/img_chapter2/sso_integration/create-realm-keycloak.png)
101+
102+
4. Click "Save" to create the client.
103+
104+
![create client Keycloak.](../images/img_chapter2/sso_integration/create-client-keycloak.png)
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+
![Configurations Details](../images/img_chapter2/sso_integration/client-access-settings-keycloak.png)
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+
![Client Signature Required](../images/img_chapter2/sso_integration/client-signature-required.png)
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+
![Create User](../images/img_chapter2/sso_integration/create-user.webp)
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+
![Single Sign On Button](../images/img_chapter2/sso_integration/SingleSignOnButton.png)
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.
23.3 KB
Loading
370 KB
Loading
303 KB
Loading
23.3 KB
Loading
10.7 KB
Loading
106 KB
Loading
190 KB
Loading
182 KB
Loading

0 commit comments

Comments
 (0)