Skip to content

Commit 906f2cb

Browse files
authored
Merge pull request #199 from LalitDeore/master
Add docs for assigning role from sso provider to shuffle
2 parents 95b5b19 + b11cff9 commit 906f2cb

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

docs/extensions.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,38 @@ Finally go back to shuffle and use SSO button to login.
182182

183183
![shuffle SSO](https://user-images.githubusercontent.com/31187099/162689445-8db0766c-6f18-4463-8a92-f6ae62213918.png?raw=true)
184184

185+
### Assigning a Role from Keycloak to Shuffle for a New User
186+
187+
If you want to assign a Shuffle organization role (`admin`, `user`, `org-reader`) from your Keycloak client, you can achieve this using the following method:
188+
189+
Steps to Assign Roles
190+
191+
1. In your Keycloak client, create three new roles with the names `shuffle-admin`, `shuffle-user`, and `shuffle-org-reader`, as shown in the image below:
192+
193+
![image](https://github.com/user-attachments/assets/e8a1f344-73c9-453d-b119-aef4643610b4)
194+
195+
2. After creating the roles, assign them to the users you want. The `shuffle-admin`, `shuffle-user`, and `shuffle-org-reader` roles in Keycloak correspond to the `admin`, `user`, and `org-reader` roles in Shuffle.
196+
197+
3. Once the roles are assigned to users, navigate to:
198+
199+
**Client Scopes****Roles****Mapper****Client Roles**
200+
201+
On the **Client Roles** page:
202+
203+
- Update the `Token Claim Name` to `roles`
204+
- Enable the option **"Add to ID Token"** so that the roles are included in the response.
205+
206+
![image](https://github.com/user-attachments/assets/09582542-efa1-429b-9d45-e0a3796c6fbd)
207+
208+
Important Notes:
209+
210+
- After completing these settings, all newly created users will be assigned roles based on their Keycloak roles. If no role is assigned, the default role will be `user`.
211+
- As of now, role assignment is only applied to newly generated users. If a user already exists in Shuffle, changing their role in Keycloak will **not** update their role in Shuffle.
212+
In this case, you can manually change the user's role from the `https://shuffler.io/admin?tab=users` page.
213+
- You can achieve this behavior starting from Shuffle version 2.0.1 or later. Make sure you are using this version or a newer one
214+
215+
216+
185217
### Azure AD
186218
To use OpenID with Azure AD, Shuffle supports OpenID connect with the use of Client IDs and Client secrets. To set up OpenID Connect with Azure, we use "ID_token" authentication. This entails a few normal steps regarding app creation in Azure App Registration.
187219

@@ -227,6 +259,37 @@ https://github.com/user-attachments/assets/0a927283-d39e-4200-8ba3-654ef6f1b9c1
227259

228260
**Note**: Ensure that the "email" field is included in the SSO response from your SSO provider. If this field is empty, you may encounter errors. The email from your SSO provider will be assigned as the username in Shuffle.
229261

262+
263+
264+
### How to Assign a Role to a New User from an SSO Provider (OpenID Connect) in Shuffle
265+
266+
If you want to assign a role to a user from an SSO provider, you can do so using the following method:
267+
268+
1. Create three roles in your SSO application/client:
269+
- `shuffle-admin`
270+
- `shuffle-user`
271+
- `shuffle-org-reader`
272+
273+
2. Assign one of these roles to new users when granting them access to the application/client.
274+
- The `shuffle-admin`, `shuffle-user`, and `shuffle-org-reader` roles in your SSO provider correspond to the `admin`, `user`, and `org-reader` roles in Shuffle.
275+
276+
3. Ensure that the `roles` claim is included in the **ID token** response from your SSO provider.
277+
278+
After completing these steps, all newly created users will be assigned roles in Shuffle based on their assigned role in the SSO provider.
279+
280+
- If none of the specified roles are assigned, or if the `roles` claim is missing, the user will be assigned the default role: **`user`** in Shuffle.
281+
282+
Important Notes
283+
284+
1. Currently, this feature is only available for **OpenID Connect**. Support for **SAML SSO** may be added in the future.
285+
2. At this time, role assignments only apply to newly created users. If a user already exists in Shuffle, changing their role in the SSO provider **will not** update their role in Shuffle.
286+
- To manually update an existing user’s role in Shuffle, please visit the **Shuffle Admin Page**:
287+
[Shuffle Admin Page](https://shuffler.io/admin?tab=users)
288+
3. You can achieve this behavior starting from Shuffle version 2.0.1 or later. Make sure you are using this version or a newer one.
289+
290+
If you have any questions or need further assistance, please feel free to reach out to us at **[[email protected]](mailto:[email protected])**.
291+
292+
230293
## Detection Manager
231294
The Shuffle Detection Manager is a system introduced in beta in December 2024, allowing Shuffle to work with platforms like Tenzir and other systems to help with Detection Engineering. The goal of the system is not to replace actual detection systems themselves, but to offer a centralized way to control Detection rules across tenants and different tools. As an example, **below is a focus on Sigma rules with Tenzir**. The system is tested with Yara rules, Email detection rules and custom rule systems.
232295

0 commit comments

Comments
 (0)