Files
Akshay Gaikwad c4ac043b5e feat: Support more than one IdP groups mapping (#172)
Allow mapping more than one IdP groups to an OIdC identity. This
commit upgrades the kratos version (v0.11.0). Kratos v0.11.0 parses
all id token claims into `raw_claims`. The `raw_claims` can be used in
JsonNet mapper to map non-standard claims like `groups` to identity
traits.

Fixes #109

This also includes:
* Remove verbose bug debug logs
* Removes elasticsearch service from docker compose file

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>
2023-03-30 12:43:57 +05:30

19 lines
654 B
Jsonnet

// Issuer Url: <Okta domain url>
// scopes: email, profile, openid
local claims = std.extVar('claims');
local fName = if "name" in claims && claims.name!=null && std.length(std.findSubstr(" ", claims.name)) > 0 then std.splitLimit(claims.name, " ", 1)[0] else "Paralus";
local lName = if "name" in claims && claims.name!=null && std.length(std.findSubstr(" ", claims.name)) > 0 then std.splitLimit(claims.name, " ", 1)[1] else "User";
{
identity: {
traits: {
email: claims.email,
first_name: fName,
last_name: lName,
[if "groups" in claims.raw_claims then "idp_groups" else null]: claims.raw_claims.groups,
},
},
}