-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[ZT] Access for SaaS: SAML attributes #20503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1369e58
SAML attribute features
ranbel c1af3ac
Update src/content/docs/cloudflare-one/applications/configure-apps/sa…
ranbel a6b5e1f
Update src/content/docs/cloudflare-one/applications/configure-apps/sa…
ranbel 88c44a3
update groups example
ranbel 3d86a40
Merge branch 'ranbel/access-for-saas-SAML' of github.com:cloudflare/c…
ranbel c913375
add more JSONata examples
ranbel 542b121
Update src/content/docs/cloudflare-one/applications/configure-apps/sa…
ranbel 9b7eab5
Update src/content/docs/cloudflare-one/applications/configure-apps/sa…
ranbel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,9 +39,9 @@ Obtain the following URLs from your SaaS application account: | |
|
|
||
| 8. Select the **Name ID Format** expected by your SaaS application (usually _Email_). | ||
|
|
||
| 9. Copy the **SSO endpoint**, **Access Entity ID or Issuer**, and **Public key**. | ||
| 9. (Optional) Configure any additional [SAML attribute statements](#saml-attributes) required by your SaaS application. | ||
|
|
||
| 10. If your SaaS application requires additional **SAML attribute statements**, add the mapping of your IdP's attributes you would like to include in the SAML statement sent to the SaaS application. | ||
| 10. Copy the **SSO endpoint**, **Access Entity ID or Issuer**, and **Public key**. | ||
|
|
||
| :::note[IdP groups] | ||
|
|
||
|
|
@@ -77,3 +77,157 @@ When acting as a SAML identity provider, Cloudflare will sign both the SAML Resp | |
| ## 4. Test the integration | ||
|
|
||
| Open an incognito browser window and go to the SaaS application's login URL. You will be redirected to the Cloudflare Access login screen and prompted to sign in with your identity provider. | ||
|
|
||
| ## SAML attributes | ||
|
|
||
| [SAML attributes](/cloudflare-one/identity/idp-integration/generic-saml/#saml-headers-and-attributes) refer to the user identity characteristics that Cloudflare Access shares with your SAML SaaS application upon successful authentication. By default, Cloudflare Access passes the following attributes (if available) to the SaaS application: | ||
| - `id` - UUID of the user's Access identity | ||
| - `name` - Full name of the user (for example, `John Doe`) | ||
| - `email` - User's email address | ||
| - `groups` - Identity provider group membership | ||
|
|
||
| In Access for SaaS, you can add additional SAML attributes and customize the SAML statement sent to the SaaS application. This allows you to integrate SaaS applications which have specific SAML attribute requirements. | ||
|
|
||
| ### SAML attribute statements | ||
|
|
||
| To send additional SAML attributes to your SaaS application, configure the following fields for each attribute: | ||
|
|
||
| - **Name**: SAML attribute name | ||
| - **SAML friendly name**: (Optional) A human readable name for the SAML attribute | ||
| - **Name format**: Specify the **Name** format expected by the SaaS application: | ||
| - `Unspecified`: (default) No specific format required. | ||
| - `URI`: Name is in a format such as `urn:ietf:params:scim:schemas:core:2.0:User:userName` or `urn:oid:2.5.4.42`. | ||
| - `Basic`: Name is a normal string such as `userName`. | ||
| - **IdP claim**: The identity provider value that should map to this SAML attribute. You can select any [SAML attribute](/cloudflare-one/identity/idp-integration/generic-saml/#saml-headers-and-attributes) or [OIDC claim](/cloudflare-one/identity/idp-integration/generic-oidc/#oidc-claims) that was configured in a Zero Trust IdP integration. | ||
| - **Required**: If a claim is marked as required but is not provided by an IdP, Cloudflare will fail the authentication request and show an error page. | ||
| - **Add per IdP claim**: (Optional) If you turned on multiple identity providers for the SaaS application, you can choose different attribute mappings for each IdP. These values will override the parent **IdP claim**. | ||
|
|
||
| ### Transformation | ||
|
|
||
| In **Advanced settings** > **Transformation**, you can enter a [JSONata](https://jsonata.org/) script that modifies SAML attributes before they are sent to the SaaS application. This is useful for setting defaults, excluding email addresses, or ensuring usernames meet arbitrary criteria. | ||
ranbel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| For example, the following JSONata script modifies the `groups` attribute: | ||
|
|
||
| ```jsonata title="JSONata expression" | ||
| { | ||
| "account_id": account_id, | ||
| "amr": amr, | ||
| "auth_status": auth_status, | ||
| "common_name": common_name, | ||
| "devicePosture": devicePosture, | ||
| "device_id": device_id, | ||
| "device_sessions": device_sessions, | ||
| "email": email, | ||
| "gateway_account_id": gateway_account_id, | ||
| "geo": geo, | ||
| "groups": $map($.groups, function($group) { | ||
ranbel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| {"group_name": $group.name, "id": $group.id} | ||
| }), | ||
| "iat": iat, | ||
| "id": id, | ||
| "idp": idp | ||
| } | ||
| ``` | ||
|
|
||
| Here is an example of an Access for SaaS payload before applying the transform: | ||
ranbel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```json title= "Before JSONata transform" collapse={2-25, 40-45} | ||
| { | ||
| "account_id": "699d98642c564d2e855e9661899b7252", | ||
| "amr": [ | ||
| "pwd" | ||
| ], | ||
| "auth_status": "NONE", | ||
| "common_name": "", | ||
| "device_id": "c1744f8b-faa1-48a4-9e5c-02ac921467fa", | ||
| "device_sessions": { | ||
| "49e653db-991e-11ee-af26-2243bf8c3428": { | ||
| "last_authenticated": 1703004275 | ||
| } | ||
| }, | ||
| "devicePosture": { | ||
| "8534a230-e85e-4183-8964-a4b7dcf72986": { | ||
| "rule_name": "Warp", | ||
| "success": true, | ||
| "type": "warp" | ||
| } | ||
| }, | ||
| "email": "[email protected]", | ||
| "gateway_account_id": "bTSquyUGwLQjYJn8cI8S1h6M6wU", | ||
| "geo": { | ||
| "country": "US" | ||
| }, | ||
| "groups": [ | ||
| { | ||
| "id": "12fdf91a-fb23-41b3-995a-de2f72c61d0e", | ||
| "name": "IdentityProtection-RiskyUser-RiskLevel-low" | ||
| }, | ||
| { | ||
| "id": "12348f47-8234-4860-a03f-c2a1513f267b", | ||
| "name": "Global Administrator" | ||
| }, | ||
| { | ||
| "id": "11235980-87d7-4917-b0aa-74c01914c40e", | ||
| "name": "Application Administrator" | ||
| } | ||
| ], | ||
| "iat": 1659474397, | ||
| "id": "OidHvkPt-I-13IBSnd77UJ8cHgsrUpjs3W6_4t6ES7M", | ||
| "idp": { | ||
| "id": "b08e8c0c-a75d-4b3f-8e7b-cd427b7c7b47", | ||
| "type": "azureAD" | ||
| } | ||
| ``` | ||
|
|
||
| Here is the payload after applying the example JSONata transform: | ||
|
|
||
| ```json title="After JSONata transform" collapse={2-25, 40-45} | ||
| { | ||
| "account_id": "699d98642c564d2e855e9661899b7252", | ||
| "amr": [ | ||
| "pwd" | ||
| ], | ||
| "auth_status": "NONE", | ||
| "common_name": "", | ||
| "devicePosture": { | ||
| "8534a230-e85e-4183-8964-a4b7dcf72986": { | ||
| "rule_name": "Warp", | ||
| "success": true, | ||
| "type": "warp" | ||
| } | ||
| }, | ||
| "device_id": "c1744f8b-faa1-48a4-9e5c-02ac921467fa", | ||
| "device_sessions": { | ||
| "49e653db-991e-11ee-af26-2210bf8c3428": { | ||
| "last_authenticated": 1703004275 | ||
| } | ||
| }, | ||
| "email": "[email protected]", | ||
| "gateway_account_id": "bTSquyUGwLQjYJn8cI8S1h6M6wU", | ||
| "geo": { | ||
| "country": "US" | ||
| }, | ||
| "groups": [ | ||
| { | ||
| "group_name": "IdentityProtection-RiskyUser-RiskLevel-low", | ||
| "id": "62fdf91a-fb4f-41b3-995a-de2f72c61d0e" | ||
| }, | ||
| { | ||
| "group_name": "Global Administrator", | ||
| "id": "25928f47-8465-4860-a03f-c2a1513f267b" | ||
| }, | ||
| { | ||
| "group_name": "Application Administrator", | ||
| "id": "55225980-87d7-4917-b0aa-74c01914c40e" | ||
| } | ||
| ], | ||
| "iat": 1659474397, | ||
| "id": "OidHvkPt-I-13IBSnd77UJ8cHgsrUpjs3W6_4t6ES7M", | ||
| "idp": { | ||
| "id": "b08e8c0c-a75d-4b3f-8e7b-cd427b7c7b47", | ||
| "type": "azureAD" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| In this example, the JSONata transform changed the `group.name` field from `name` to `group_name`. Additionally, we changed the value of `group.id` from ___ to ____. | ||
ranbel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.