Skip to content
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

docs: added documentation for data mapping of SAML attributes #2078

Merged
merged 8 commits into from
Apr 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/kratos/organizations/organizations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,37 @@ curl -X PATCH --location "https://api.console.ory.sh/projects/$PROJECT_ID" \

The SAML application callback URL to set at our SAML Identity Provider is: `https://api.console.ory.sh/saml/api/oauth/saml`

#### Data mapping

You can configure the mapping of SAML attributes to Ory's identity schema using Jsonnet. All custom SAML attributes defined at the
Identity Provider (IdP) will be available in the `raw_claims` object within `claims`. These attributes can then be mapped to the
Ory identity schema.

:::warning

Ensure that the appropriate identity schema is created before mapping attributes. The email attribute is natively available in
`claims.email`, everything else is nested under `claims.raw_claims`.

:::

#### Example SAML data mapping

Mapping `firstName` and `lastName` from the SAML Identity Provider to the Ory identity schema (traits).

```jsonnet
local claims = std.extVar('claims');

{
identity: {
traits: {
email: claims.email,
[if std.objectHas(claims, "raw_claims") && std.objectHas(claims.raw_claims, "firstName") then "firstName" else null]: claims.raw_claims.firstName,
[if std.objectHas(claims, "raw_claims") && std.objectHas(claims.raw_claims, "lastName") then "lastName" else null]: claims.raw_claims.lastName,
},
},
}
```

### SAML via BoxyHQ

:::note
Expand Down
Loading