Add Okta mapper jsonnet file

This commit is contained in:
Akshay Gaikwad
2022-06-15 12:31:13 +05:30
parent 2be628f551
commit 4ad3cb22b0
+18
View File
@@ -0,0 +1,18 @@
// 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 "team" in claims then "idp_group" else null]: claims.team,
},
},
}