Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Auth.js · Const

Line

Line is Auth.js’s built-in LINE integration. Configure it with LINE OAuth credentials and register the provider with Auth.js to add LINE login.

How it works

Line is a built-in Auth.js OAuth/OIDC provider. Calling it with LINE OAuth credentials returns a provider configuration that Auth.js uses to handle LINE sign-in and its callback.

Syntax

Line(options)

Parameters

NameTypeDescription
optionsOAuthUserConfig<P>Provider options, including LINE OAuth credentials and other OAuth configuration overrides.

Returns

OAuthConfig<P>

Key points

  • Auth.js includes LINE as a ready-made provider rather than requiring a custom OAuth implementation.
  • Start by creating a LINE login channel in the LINE Developer Console.
  • Enable the web app option under LINE Login and register the Auth.js callback URL.
  • The provider supplies standard configuration values, while its options allow application-specific overrides.
  • The factory's options parameter is an OAuthUserConfig for the provider profile type.

Common mistakes

  • Email is not available automatically; request the Email address permission in the LINE Developer Console.
  • The provider uses the OIDC interpretation by default, so account setup should match LINE's OpenID Connect configuration.

Example: Configure LINE with Auth.js

import { Auth } from "@auth/core"
import Line from "@auth/core/providers/line"

const request = new Request(origin)
const response = await Auth(request, {
  providers: [
    Line({
      clientId: process.env.AUTH_LINE_ID,
      clientSecret: process.env.AUTH_LINE_SECRET,
    }),
  ],
})

Register the built-in LINE provider with the credentials from the LINE Developer Console, then pass it to Auth.js.

When to use it

Add LINE as a login method

Social sign-in

Supply LINE client credentials

OAuth configuration

Request permitted LINE profile data

Profile access

Override built-in OAuth defaults

Provider customization

Interview questions

QWhat does the Line provider factory accept and return?

The Line function accepts an OAuthUserConfig for a LineProfile and returns an OAuthConfig for that profile. Passing the resulting configuration in Auth.js's providers list enables LINE authentication.

Follow-up: How would you change the built-in settings? Use the provider function's options to override defaults, following Auth.js's built-in OAuth provider customization guidance.

QWhich callback URL must be registered for LINE?

The callback URL shown by the reference page is https://example.com/api/auth/callback/line. The corresponding URL must be configured for the LINE Login channel.

Follow-up: What should be checked if callbacks fail? Confirm that the deployed callback URL exactly matches the URL registered in the LINE Developer Console.

QWhat LINE-side setup is required?

Create a LINE login channel in the LINE Developer Console, activate the web app under LINE Login, and configure its callback URL. The provider can then be registered with a client ID and client secret.

Follow-up: How is email access enabled? Apply for Email address permission under OpenID Connect in the channel's settings.

  • LineProfile
  • OAuthUserConfig
  • OAuthConfig
  • Auth
  • customizing a built-in OAuth provider

Source: Line - Auth.js. Checked 2026-10-15.