new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Better Auth · Authentication · all subjects

social sign-on/line

10 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

LINE ID token sign-in

LINE supports sign-in using an ID token obtained on the client. Call authClient.signIn.social() with provider set to 'line' and an idToken object containing token (the LINE ID token) and accessToken (the LINE access token). This allows direct sign-in without redirection.

LINE provider configuration in auth.ts

To configure LINE as a social provider, add credentials to socialProviders.line in the auth configuration. The configuration object accepts clientId (required), clientSecret (required), redirectURI (optional, defaults to http://localhost:3000/api/auth/callback/line), scope (optional array to add additional scopes), and disableDefaultScope (optional boolean to replace default scopes).

LINE sign-in with social method

To implement LINE sign-in, use authClient.signIn.social() with provider set to 'line'. This initiates the OAuth flow with LINE.

LINE default scopes

The default scopes for LINE authentication are openid, profile, and email. These can be adjusted via the scope provider option, or replaced entirely by setting disableDefaultScope to true.

LINE credentials setup steps

To get LINE credentials: Create a channel in the LINE Developers Console; note the Channel ID (used as clientId) and Channel secret (used as clientSecret); in channel settings add the Redirect URI (e.g., http://localhost:3000/api/auth/callback/line for local development); enable required scopes with at least openid, and add profile and email if needed for name, avatar, and email.

LINE redirect URI must match exactly

The redirect URI configured in the Better Auth provider must exactly match the Redirect URI value configured in the LINE Developers Console.

LINE multi-channel support with Generic OAuth plugin

LINE requires separate OAuth channels for different countries (Japan, Thailand, Taiwan, etc.), each with its own clientId and clientSecret. The standard socialProviders.line configuration only supports a single channel. To support multiple countries, use the Generic OAuth plugin with the line() helper function. This allows configuring multiple LINE providers with different providerId values (e.g., line-jp, line-th, line-tw).

LINE multi-channel provider configuration example

Use genericOAuth plugin with line() helper to configure multiple LINE channels. Each line() call accepts providerId (unique identifier for that channel), clientId, and clientSecret. Example: line({ providerId: 'line-jp', clientId: process.env.LINE_JP_CLIENT_ID, clientSecret: process.env.LINE_JP_CLIENT_SECRET }) for Japan channel.

LINE multi-channel sign-in

When using multiple LINE channels configured with Generic OAuth plugin, sign in by calling authClient.signIn.social() with the provider set to the appropriate channel's providerId (e.g., 'line-jp', 'line-th', 'line-tw') to identify which channel to use.

LINE ID token verification

LINE ID token verification uses the official endpoint and checks audience and optional nonce per specification.

Give your agent this brain