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

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

Facebook provider configuration in Better Auth

Import betterAuth and configure the facebook provider under the socialProviders option with clientId and clientSecret from environment variables.

Facebook Login for Business setup

Better Auth supports Facebook Login for Business. Provide the configId from Facebook Login For Business > Configurations alongside your clientId and clientSecret. The app must be a Business app and the configuration must be of the 'User access token' type; 'System-user access token' is not supported.

Facebook may omit email address

Facebook may omit the email field even when the permission is granted, due to phone-only accounts, revoked consent, or addresses Meta has marked invalid. Use mapProfileToUser as a fallback to handle providers without email.

Facebook sign-in with social function

Use authClient.signIn.social() with provider set to 'facebook' to initiate Facebook sign-in on the client.

Facebook provider scopes configuration

The scopes option overrides Facebook permissions. Default scopes are 'email' and 'public_profile'. The fields option extends the list of fields to retrieve from the Facebook user profile; default fields are 'id', 'name', 'email', 'picture'.

Facebook provider setup: get credentials

To use Facebook sign in with Better Auth, you need a client ID and client Secret from the Facebook Developer Portal. Navigate to your app, then App Settings > Basic. The App ID becomes your clientId and the App Secret becomes your clientSecret.

Facebook provider clientSecret security warning

The clientSecret is sensitive information and must not be exposed in client-side code such as frontend apps.

Facebook provider redirect URL configuration

Set the redirect URL to http://localhost:3000/api/auth/callback/facebook for local development. For production, set it to your application's URL. If you change the base path of the auth routes, update the redirect URL accordingly.

Facebook sign-in with ID token or access token

Use authClient.signIn.social() with the idToken parameter to sign in using an ID token from the client-side. For limited login, pass idToken.token. For access token only, pass both idToken.token and idToken.accessToken together. When ID token is provided, no redirection occurs and the user is signed in directly.

Give your agent this brain