Skip to main content

LinkedIn authentication

Not yet available (2.4.x)

The LinkedIn provider is not enabled yet. Only Google is live right now — calling auth.signIn() with this provider throws AuthErrorCode.PROVIDER_NOT_ENABLED. The page below documents its intended shape for when it is re-enabled. See the provider overview and the Google provider.

The LinkedIn provider signs users in with a manual OAuth authorization-code flow protected by S256 PKCE. After the code exchange it fetches the real profile from LinkedIn's OpenID Connect /v2/userinfo endpoint.

When you need a backend

A backend is optional. The PKCE-protected code flow can complete in the browser. If your LinkedIn app requires a client secret for the token exchange, keep it server-side — do not ship clientSecret in the browser bundle.

Configuration

import { auth } from 'capacitor-auth-manager';

auth.configure({
providers: {
linkedin: {
clientId: 'YOUR_LINKEDIN_CLIENT_ID',
redirectUri: 'https://your-app.com/auth/linkedin/callback',
scopes: ['openid', 'profile', 'email'],
},
},
});

Options

From the LinkedInAuthOptions interface in src/definitions.ts:

OptionTypeRequiredPurpose
clientIdstringYesLinkedIn app client ID.
redirectUristringYesRedirect URI registered with the LinkedIn app.
clientSecretstringNoServer-side only — keep out of the browser bundle.
scopesstring[]NoOpenID Connect scopes (e.g. openid, profile, email).
statestringNoCSRF state value.

Sign in

await auth.signIn('linkedin');

Notes & caveats

  • The flow uses S256 PKCE (code_challenge_method=S256) generated by the library.
  • The profile is fetched from https://api.linkedin.com/v2/userinfo; a network failure there surfaces as a clear error.
  • The library does not verify ID-token signatures in the browser — re-validate server-side if you trust the claims.