Add LINE as a login method
Social sign-in
Auth.js · Const
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.
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.
Line(options)| Name | Type | Description |
|---|---|---|
options | OAuthUserConfig<P> | Provider options, including LINE OAuth credentials and other OAuth configuration overrides. |
OAuthConfig<P>
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.
Social sign-in
OAuth configuration
Profile access
Provider customization
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.
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.
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.
LineProfileOAuthUserConfigOAuthConfigAuthcustomizing a built-in OAuth provider