Facebook
Facebook Login (Graph API v24.0). OAuth2 without PKCE, plus a separate Limited Login path whose JWTs are verified against Facebook's dedicated JWKS.
Configure
python
from better_auth import BetterAuth
from better_auth.oauth.providers_ext import Facebook
auth = BetterAuth(
secret=...,
social_providers={
"facebook": Facebook(client_id="…", client_secret="…"),
},
)Or name-keyed (no import):
python
auth = BetterAuth(
secret=...,
social_providers={
"facebook": {"client_id": "…", "client_secret": "…"},
},
)Options
| Field | Type | Default | Notes |
|---|---|---|---|
client_id | str | list[str] | required | The app id. Also used (with client_secret) to app-bind opaque tokens via debug_token. |
client_secret | str | required | |
fields | list[str] | [] | Extra Graph profile fields appended to the /me request (beyond id,name,email,picture). |
config_id | str | None | None | Facebook login configuration id — sent as the config_id authorize param. |
disable_id_token_sign_in | bool | False | Refuse direct token sign-in (both JWT and opaque paths). |
All shared ProviderConfig options apply.
Notes
- Default scopes:
email public_profile. - Register
{base_url}{base_path}/callback/facebookas a valid OAuth redirect URI in the Meta developer console. - Two token paths on direct sign-in: a 3-segment JWT is a Limited Login token, verified against
https://limited.facebook.com/.well-known/oauth/openid/jwks/(issuerhttps://www.facebook.com); anything else is an opaque access token, validated through Graphdebug_token(must be valid, bound to a configured app id, and carry auser_id). - The Graph
/meendpoint is not app-bound, so the access token is app-verified viadebug_tokenbefore its profile is trusted, and the returned profileidmust match the token'suser_id. - Limited-Login id tokens carry no
email_verifiedclaim — mapped asFalse.