OAuth integration

Lucia provides an external, server-side library that makes implementing authentication flow with OAuth and Open ID Connect easy.

It mainly handles 2 parts of the authentication process. First, it generates an authorization URL for your users to be redirected to. Once the user authenticates with the provider, they will be redirected back to your application with a code. You can then pass this code to the integration to be validated.

We support a handful of popular providers out of the box (full list below), but we also provide helpers that support most OAuth 2.0 and Open ID Connect implementations.

npm i @lucia-auth/oauth
pnpm add @lucia-auth/oauth
yarn add @lucia-auth/oauth

Get started with OAuth 2.0 authorization code grant type or OAuth 2.0 with PKCE.

Step-by-step guides#

We also have framework specific guides.

Built-in providers#