← Cloudflare One / cloudflare-one / integrations / identity-providers
Generic OIDC
Cloudflare Access has a generic OpenID Connect (OIDC) connector to help you integrate IdPs not already set in Access.
1. Create an application in your identity provider
-
Visit your identity provider and create a client/app.
-
When creating a client/app, your IdP may request an authorized redirect URI. Enter the following URL:
https://<your-team-name>.cloudflareaccess.com/cdn-cgi/access/callbackYou can find your team name in the Cloudflare dashboard ↗ under Settings > Team name and domain > Team name.
-
Copy the content of these fields:
- Client ID
- Client secret
- Auth URL: The
authorization_endpointURL of your IdP - Token URL: The
token_endpointURL of your IdP - Certificate URL: The
jwks_uriendpoint of your IdP to allow the IdP keys to sign the tokens
You can find these values on your identity provider's OIDC discovery endpoint. Some providers call this the "well-known URL".
2. Add an OIDC provider to Cloudflare One
-
In the Cloudflare dashboard ↗, go to Zero Trust > Integrations > Identity providers.
-
Under Your identity providers, select Add new identity provider.
-
Choose OpenID Connect.
-
Name your identity provider and fill in the required fields with the information obtained from your identity provider.
-
(Optional) Enable Proof of Key Exchange (PKCE) ↗ if the protocol is supported by your IdP. PKCE will be performed on all login attempts.
-
(Optional) To enable SCIM, refer to Synchronize users and groups.
-
(Optional) Under Optional configurations, enter custom OIDC claims that you wish to add to users' identity. This information will be available in the user identity endpoint.
-
Select Save.
Make a POST request to the Identity Providers endpoint:
Required API token permissions
At least one of the following token permissions is required:Access: Organizations, Identity Providers, and Groups Write
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/identity_providers" \
--request POST \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{
"name": "Generic OIDC example",
"type": "oidc",
"config": {
"client_id": "<your client id>",
"client_secret": "<your client secret>",
"auth_url": "https://accounts.google.com/o/oauth2/auth",
"token_url": "https://accounts.google.com/o/oauth2/token",
"certs_url": "https://www.googleapis.com/oauth2/v3/certs",
"pkce_enabled": false,
"email_claim_name": "email",
"claims": [
"employeeID",
"groups"
],
"scopes": [
"openid",
"email",
"profile"
]
}
}'-
Add the following permission to your
cloudflare_api_token↗:Access: Organizations, Identity Providers, and Groups Write
-
Configure the
cloudflare_zero_trust_access_identity_provider↗ resource:resource "cloudflare_zero_trust_access_identity_provider" "generic_oidc_example" { account_id = var.cloudflare_account_id name = "Generic OIDC example" type = "oidc" config = { client_id = "<your client id>" client_secret = "<your client secret>" auth_url = "https://accounts.google.com/o/oauth2/auth" token_url = "https://accounts.google.com/o/oauth2/token" certs_url = "https://www.googleapis.com/oauth2/v3/certs" pkce_enabled = false email_claim_name = "email" claims = ["employeeID", "groups"] scopes = ["openid", "email", "profile"] } }
3. Test the connection
To test that your connection is working, go to Authentication > Login methods and select Test next to the login method you want to test. On success, a confirmation screen displays.
Synchronize users and groups
The generic OIDC integration allows you to synchronize user groups and automatically deprovision users using SCIM.
SCIM affects Access and Gateway policy evaluation differently.
Access evaluates a user's identity and group membership from the SAML assertion or OIDC token returned by the identity provider during authentication. SCIM provides readable group names in the Access policy builder, but Access does not use SCIM group membership to evaluate a login. If you turn on Enable user deprovisioning, removing a user from the SCIM application revokes their active Access sessions. You can also configure SCIM to revoke sessions after group membership changes. Access evaluates the updated identity provider data when the user authenticates again.
Gateway evaluates identity-based policies against the User Registry identity. SCIM updates this identity when users or group memberships change, without waiting for the user to authenticate again. Cloudflare One Client device profiles use the same synchronized identity.
Prerequisites
Your identity provider must support SCIM version 2.0.
1. Enable SCIM in Cloudflare One
-
In the Cloudflare dashboard ↗, go to Zero Trust > Integrations > Identity providers.
-
Find the IdP integration and select Edit.
-
Turn on Enable SCIM.
-
(Optional) Configure the following settings:
- Enable user deprovisioning: Revoke a user's active session when they are removed from the SCIM application in IdP. This will invalidate all active Access sessions and prompt for reauthentication for any Cloudflare One Client session policies.
- Remove user seat on deprovision: Remove a user's seat from your Cloudflare One account when they are removed from the SCIM application in IdP.
- SCIM identity update behavior: Choose what happens in Cloudflare One when the user's identity updates in IdP.
- Automatic identity updates: Automatically update the User Registry identity when IdP sends an updated identity or group membership through SCIM. This identity is used for Gateway policies and Cloudflare One Client device profiles; Access will read the user's updated identity when they reauthenticate.
- Group membership change reauthentication: Revoke a user's active session when their group membership changes in IdP. This will invalidate all active Access sessions and prompt for reauthentication for any Cloudflare One Client session policies. Access will read the user's updated group membership when they reauthenticate.
- No action: Update the user's identity the next time they reauthenticate to Access or the Cloudflare One Client.
-
Select Regenerate Secret. Copy the SCIM Endpoint and SCIM Secret. You will need to enter these values into IdP.
-
Select Save.
The SCIM secret never expires, but you can manually regenerate the secret at any time.
2. Configure SCIM in the IdP
Setup instructions vary depending on the identity provider. In your identity provider, you will either need to edit the original SSO application or create a new SCIM application. Refer to your identity provider's documentation for more details. For example instructions, refer to our Okta or Jumpcloud guides.
IdP groups
If you would like to build policies based on IdP groups:
- Ensure that your IdP sends a
groupsfield. The naming must match exactly (case insensitive). All other values will be sent as a OIDC claim. - If your IdP requires a new SCIM application, ensure that its groups match the groups in the original SSO application. Matching the groups keeps the Gateway identity synchronized with the groups that the IdP returns when the user authenticates to Access.
3. Verify SCIM provisioning
To check if user identities were updated in Cloudflare One, view your SCIM provisioning logs.
Optional configurations
Custom OIDC claims
All OIDC IdP integrations support the use of custom OIDC claims. Once configured, Access will add the claims to the Access JWT for consumption by your origin services. You can reference the custom OIDC claims in Access policies and Gateway policies, offering a means to control user access to applications based on custom identity attributes.
To add a custom OIDC claim to an IdP integration:
-
In your identity provider, ensure that the custom claim is included in your OIDC ID token.
-
In the Cloudflare dashboard ↗, go to Zero Trust > Integrations > Identity providers.
-
Under Your identity providers, find your identity provider and select Edit.
-
Under OIDC Claims, enter the name of your custom claim (for example,
oid). -
Select Save.
-
Select Test and verify that the custom claim appears in
oidc_fields. For example,"oidc_fields": { "oid": "54eb1ed2-7150-44e6-bbe4-ead24c132fd4" },
You can now build an Access policy for the custom claim using the OIDC Claim or IdP OIDC Claim selector. You can also use custom OIDC claims as identity-based selectors in Gateway policies. The custom claim will be passed to origins behind Access in a JWT.
Email claim
You can specify a custom Email claim name that Access will use to identify user emails. This is useful if your IdP does not return the standard email claim in the OIDC ID token.
Multi-record OIDC claims
Cloudflare Access extends support for multi-record OIDC claims. These claims are parsed out and can be individually referenced in policies. This feature enables granular access control and precise user authorization in applications.
Cloudflare Access does not support partial OIDC claim value references or OIDC scopes.
Supported algorithms for generic OIDC tokens
Cloudflare supports the following algorithms for verifying generic OIDC tokens:
- RS512
- RS256
- PS512
- ES256
- ES384
- ES512