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/lineConfigure
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
| Scope | What it unlocks |
|---|---|
openid | OIDC identity token |
profile | Display name and profile picture |
email | Email 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
| Method | Path | Description |
|---|---|---|
| GET | /auth/oauth/authorize/line | Redirect to LINE |
| GET | /auth/oauth/callback/line | Handle callback |