CookbookSocial login
Add LinkedIn as a social login provider
Configure LinkedIn OAuth as an alternate login method
LinkedIn login is most useful for B2B products targeting professionals. The flow is straightforward but LinkedIn's API has changed often, check current docs.
Step 1: Register LinkedIn App
- LinkedIn Developers → Create App.
- Verify company (LinkedIn requires this).
- Products → Sign In with LinkedIn using OpenID Connect → request.
- Auth → OAuth 2.0 settings → Authorized redirect URLs:
https://ciam.your-domain/self-service/methods/oidc/callback/linkedin. - Copy Client ID and Client Secret.
Step 2: Configure Kratos
selfservice:
methods:
oidc:
config:
providers:
- id: linkedin
provider: generic
issuer_url: https://www.linkedin.com/oauth
client_id: <linkedin-client-id>
client_secret: <linkedin-client-secret>
scope: [openid, profile, email]
mapper_url: file:///etc/config/kratos/oidc.linkedin.jsonnetoidc.linkedin.jsonnet:
local claims = std.extVar('claims');
{
identity: {
traits: {
email: claims.email,
name: { first: claims.given_name, last: claims.family_name },
},
},
}Note: Kratos has provider: linkedin shorthand for older versions; newer Kratos uses generic + issuer_url per the OIDC standard.
Use cases
- B2B SaaS where the audience is professionals.
- Networking / recruiting platforms.
For pure B2C, Google + Apple cover more users.