This library provides a LinkedIn authentication strategy for `remix-auth`, enabling users to log into Remix applications via their LinkedIn accounts. It extends `remix-auth-oauth2` and is currently at version 2.0.1, shipping with full TypeScript definitions for robust development. The package maintains a steady release cadence, with recent updates focused on dependency upgrades and critical API changes. A significant update in version 2.0.0 involved transitioning from LinkedIn's legacy OAuth 2.0 flow to the newer OpenID Connect standard, reflecting LinkedIn's evolving authentication protocols. This change required corresponding adjustments in application setup and profile handling. `remix-auth-linkedin` supports both Node.js and Cloudflare runtimes, making it versatile for various Remix deployment environments. Developers must register an OAuth application on the LinkedIn Developers page to obtain the necessary `clientID` and `clientSecret` for integration. It seamlessly integrates with `remix-auth`'s session management, leveraging `createCookieSessionStorage` or similar for authentication persistence.
npm install remix-auth-linkedinVerified import paths — ran on the pinned version, not inferred.
This code snippet demonstrates the setup of `LinkedinStrategy` with `remix-auth`, including session storage configuration and the essential authentication callback, providing a foundation for user login workflows.
Update your LinkedIn application configuration to support OpenID Connect and adjust your strategy callback function to handle the new `LinkedinProfile` structure and returned data.
Ensure `callbackURL` is configured with a full URL like `https://your-domain.com/auth/linkedin/callback` and registered correctly in your LinkedIn developer application settings.
Use environment variables (e.g., `process.env.LINKEDIN_CLIENT_ID` and `process.env.LINKEDIN_CLIENT_SECRET`) to securely provide these credentials to the `LinkedinStrategy` constructor.
Generate a strong, random, and unique secret string for production environments, ideally loaded from an environment variable (e.g., `process.env.SESSION_SECRET`) and ensure it's kept confidential.
Verify your `clientID` and `clientSecret` values against your LinkedIn developer application settings. Ensure they are correctly passed to the `LinkedinStrategy` constructor and are loaded from secure environment variables.
Ensure the `callbackURL` passed to `LinkedinStrategy` (e.g., `https://example.com/auth/linkedin/callback`) exactly matches an authorized redirect URI in your LinkedIn developer application settings, including protocol, domain, and path.
Confirm that `export const authenticator = new Authenticator(...)` is executed, that `authenticator.use(linkedinStrategy, 'linkedin')` is called, and that the strategy name 'linkedin' is consistently used in all `authenticator.authenticate` calls.