Hi! I’m trying to set up social sign in with Azure...
# talk-kratos
f
Hi! I’m trying to set up social sign in with Azure AD, and I’m struggling to map the
given_name
and
family_name
claims. My mapping schema looks like this:
Copy code
local claims = std.extVar('claims');
{
  identity: {
    traits: {
      [if 'given_name' in claims.raw_claims then 'firstName' else null]: claims.raw_claims.given_name,
      [if 'family_name' in claims.raw_claims then 'lastName' else null]: claims.raw_claims.family_name,
      [if 'email' in claims.raw_claims then 'email' else null]: claims.raw_claims.email
    },
    metadata_public: {
      [if 'tid' in claims.raw_claims then 'tid' else null]: claims.raw_claims.tid
    }
  },
}
The mapping of
email
works as it should. I’ve also tried to map the
name
field and that works too. My knowledge of Azure AD is not great, but I stumbled across this page, which may suggest that
given_name
and
family_name
are optional in some way?
s
@few-balloon-32118 hey, were you able to solve this? How did you do to add the jssonnet?