OAuth 2.0 & OpenID Connect developer documentation — integrate Beezifi authentication into any application.
Beezifi Identity supports the OAuth 2.0 Authorization Code flow with OpenID Connect. Your application redirects users to Beezifi for authentication, receives a short-lived authorization code, and exchanges it for tokens.
codeclient_secret_postopenid profile emailHS256To get started, create a Beezifi account and register your application under My Apps.
client_id and client_secret.Redirect URI matching is strict — scheme, host, port, path, and trailing slash must all match exactly. Wildcards are not supported.
Redirect your user to Beezifi to begin authentication:
GET {{BASE_URL}}/api/oauth/authorize
?client_id=YOUR_CLIENT_ID
&redirect_uri=https://yourapp.com/auth/callback
&response_type=code
&scope=openid%20profile%20email
&state=RANDOM_CSRF_VALUE
&nonce=RANDOM_NONCE
If the user authenticates and grants consent, they are redirected to your
redirect_uri with ?code=AUTH_CODE&state=YOUR_STATE.
Always verify the state value matches what you sent.
Exchange the authorization code for tokens from your backend:
POST {{BASE_URL}}/api/oauth/token
Content-Type: application/json
{
"grant_type": "authorization_code",
"code": "AUTH_CODE",
"redirect_uri": "https://yourapp.com/auth/callback",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}Successful response:
{
"access_token": "eyJ...",
"id_token": "eyJ...",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "openid profile email"
}client_secret is protected.Fetch the authenticated user's profile using the access token:
GET {{BASE_URL}}/api/oauth/userinfo
Authorization: Bearer ACCESS_TOKENResponse:
{
"sub": "user-uuid",
"email": "user@example.com",
"name": "Jane Doe",
"picture": null,
"email_verified": true
}Authorization errors are returned as query parameters on the redirect URI:
access_denied — user denied consent or an access policy blocked sign-in.invalid_client — bad client credentials or inactive application.invalid_grant — expired, already-used, or mismatched authorization code / redirect URI.invalid_request — missing or malformed required parameters.Token endpoint errors are returned as JSON with an error field.
state value and verify it exactly on callback to prevent CSRF.nonce and validate it in the ID token.client_secret only in backend environment variables — never in client-side code.iss), audience (aud), expiration (exp), and nonce.localStorage for sensitive tokens; prefer HttpOnly cookies.docs/sign-in-with-beezifi.md in the repository.