kavachOS
Authentication

LINE

Sign in with LINE using OAuth 2.0.

Setup

Get credentials

Go to the LINE Developers Console and create a provider and channel. Choose LINE Login as the channel type. Add your redirect URI:

https://your-app.com/api/kavach/auth/oauth/callback/line

Configure

lib/kavach.ts
import { createKavach } from 'kavachos';
import { oauth } from 'kavachos/auth';
import { lineProvider } from 'kavachos/auth';

const kavach = await createKavach({
  database: { provider: 'sqlite', url: 'kavach.db' },
  plugins: [
    oauth({
      providers: [
        lineProvider(
          process.env.LINE_CLIENT_ID!,
          process.env.LINE_CLIENT_SECRET!,
        ),
      ],
    }),
  ],
});
LINE_CLIENT_ID=...
LINE_CLIENT_SECRET=...

Scopes

Default scopes: openid, profile, email

ScopeWhat it unlocks
openidOIDC identity token
profileDisplay name and profile picture
emailEmail address (requires email permission approval)

The email scope requires an additional approval step in the LINE Developer Console. You must agree to the LINE Login email permission terms and submit for review.

Endpoints

MethodPathDescription
GET/auth/oauth/authorize/lineRedirect to LINE
GET/auth/oauth/callback/lineHandle callback

On this page