Today I've added LinkedIn as an identity provider ...
# talk-kratos
f
Today I've added LinkedIn as an identity provider to kratos. I'm not sure, but LinkedIn is not returning
email_verified
with the callback or it is not right matched inside kratos. So every attempt to login with LinkedIn and the jsonnet snippet from the docs fails. Are you aware of this? Is this a known bug?
m
Hello @fierce-army-43735 I tested the linkedin login when it was implemented, and it worked fine for me 🤔 Can you share some steps to reproduce your problem?
f
Yes, sure. Here you will find the data mapper. It's the same like described in the kratos docs.
Copy code
local claims = {
  email_verified: false,
} + std.extVar('claims');

{
  identity: {
    traits: {
      [if 'email' in claims && claims.email_verified then 'email' else null]: claims.email,
    },
  },
}
My LinkedIn config looks like this:
Copy code
- id: linkedin
  provider: linkedin
  client_id: CLIENT_ID
  client_secret: CLIENT_SECRET
  mapper_url: file:///etc/config/kratos/oidc.linkedin.jsonnet
  scope:
    - r_emailaddress
    - r_liteprofile
If I debug
std.extVar('claims');
inside the data mapper, I get only the following data:
Copy code
"email": "EMAIL",
"given_name": "GIVEN_NAME",
"iss": "<https://login.linkedin.com/>",
"last_name": "LAST_NAME",
"picture": "PICTURE_URL",
"sub": "AAAAAA-BBB"
Is it possible that
email_verified
is missing to pass here? https://github.com/ory/kratos/blob/5de6bf46aba6c13f927ef1c4c425322a34063ca9/selfservice/strategy/oidc/provider_linkedin.go#L188
Is this helpful?