Setup
1
Get credentials
Create an OAuth client in the Cloudflare dashboard, adduser-details.read as a required scope, and register the redirect URI:2
Scopes
Default scopes:user-details.read. It must also be a required scope on the OAuth client, or sign in cannot complete.
Any other Cloudflare API scope can be added through
scopes, and must be selected on the OAuth client too.
How it works
- Authorization Code flow with PKCE (S256). The endpoints are
https://dash.cloudflare.com/oauth2/authandhttps://dash.cloudflare.com/oauth2/token. - Client credentials go in an
Authorization: Basicheader by default. If the client is registered forclient_secret_post, passtokenEndpointAuthMethod: 'client_secret_post'. - Cloudflare’s OIDC userinfo endpoint returns only
sub, so the profile is read fromGET https://api.cloudflare.com/client/v4/user. The answer is wrapped in{ success, errors, result }. The name isfirst_nameandlast_namejoined, with the email as the fallback. There is no avatar. /userdoes not say whether the email is verified, so the OAuth plugin will not link a Cloudflare login to an existing account by email.- Clients without a secret (token auth method
none) are not supported by this provider.