mirror of
https://github.com/paralus/paralus.git
synced 2026-08-24 15:47:19 +00:00
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>
19 lines
654 B
Jsonnet
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,
|
|
},
|
|
},
|
|
}
|