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/linkedin

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

LinkedIn OAuth setup - credentials and redirect URL

To use LinkedIn sign in, obtain a client ID and client secret from the LinkedIn Developer Portal at https://www.linkedin.com/developers/. Set the redirect URL to http://localhost:3000/api/auth/callback/linkedin for local development, or to your application's URL for production. If you change the base path of the auth routes, update the redirect URL accordingly.

LinkedIn OAuth product requirement

In the LinkedIn Developer Portal under products, you must select the 'Sign In with LinkedIn using OpenID Connect' product for authentication setup.

LinkedIn configuration in better-auth

Configure the LinkedIn provider by importing betterAuth and passing the provider configuration to the socialProviders option. The configuration requires clientId and clientSecret from environment variables. Example: betterAuth({ socialProviders: { linkedin: { clientId: process.env.LINKEDIN_CLIENT_ID as string, clientSecret: process.env.LINKEDIN_CLIENT_SECRET as string } } })

LinkedIn email claims may be optional

LinkedIn's email and email_verified claims are documented as optional and may be absent when no confirmed email is associated with the member. The documentation recommends using mapProfileToUser fallback for handling providers without email.

Sign in with LinkedIn client code

To sign in with LinkedIn, use the signIn.social function from the auth client with provider set to 'linkedin'. Example: import { createAuthClient } from 'better-auth/client'; const authClient = createAuthClient(); const signIn = async () => { const data = await authClient.signIn.social({ provider: 'linkedin' }) }

Give your agent this brain