How auto-provisioning from an external IdP works in Zitadel
Auto-provisioning creates a Zitadel user the first time someone authenticates through an upstream identity provider, so nobody has to be created by hand. When a customer or workforce user signs in with Google, Entra ID, Okta or another federated provider, Zitadel can create the user record in the right organization, copy the profile attributes the provider sends, and then continue the login. The feature covers four things: creating the account on first login, prefilling the profile from identity claims, assigning roles after external authentication, and refreshing stored data at later logins. Each of these is a decision you make in the Zitadel configuration for that identity provider, not a separate service you add.
Role assignment is the part that most often needs custom logic. Zitadel Actions can assign a role to users who register through an external identity provider by hooking into the external authentication flow at post creation, so a user from a given customer domain or group claim can receive the grant they need on their first visit. Before building this, confirm in the Zitadel behavior customization guide which flow and event names apply to your Zitadel version, and test each branch of your claim logic with a user from every provider you federate. Keep the mapping rules in version control so reviewers can see which claim values lead to which grants.
Auto-provisioning is the right fit when users arrive from an upstream provider and you want them active on first sign-in, such as consumer logins or a partner portal where the customer's own IdP already vouches for each person. It is not a replacement for lifecycle management. If your customer's directory is the source of truth for joiners, movers and leavers, plan SCIM for deprovisioning and changes, because Zitadel's SCIM v2 service provider interface handles lifecycle events that a login alone never reveals. Where users are few and onboarding is approved case by case, manual creation may be simpler and easier to audit. Confirm with your security and compliance team which model they expect before the first customer goes live.
Provisioning options and when each fits
This table compares five ways to create or update Zitadel users from an external identity provider, with the fit and main trade-off for each. Read it by first matching your situation to a fit column, then checking the trade-off before committing to a path. Most deployments combine two or more options, so the takeaway is to decide per identity source rather than per platform.
| Option | Best fit | Trade-off | What to confirm first |
|---|---|---|---|
| Automatic creation at first login | Customer self-service sign-in, where users arrive from a provider you do not administer | Less control over who gets an account, since any successful external login can create one | Whether account creation should be allowed for every organization or only selected ones |
| Linking to an existing account | Users who already have a local Zitadel account and now also sign in with a social or enterprise provider | Requires a reliable matching key, so mismatched or unverified emails can attach to the wrong account | Which attribute is trusted for matching and whether the provider verifies it |
| Prefilled profile fields from claims | Workforce logins where the central directory already holds name and contact data | Depends on claim quality; missing or stale claims leave profiles incomplete or wrong | Which claims each provider sends and how often their values change |
| Role assignment with Actions after external login | Customer tenants or internal apps that need a role granted at first registration | More build and test effort, since the Action logic and role grants must be written and maintained | How the Action reads IdP claims and which role names exist in each project |
| SCIM v2 lifecycle provisioning | Workforce with a central directory that must add, change and deactivate users outside of login | Requires the directory side to run a SCIM client and maintain attribute mapping | Whether your directory supports SCIM v2 and which attributes it will send |
| Migration from another identity system | Moving existing users in while they keep signing in, using just-in-time creation | Migrated accounts depend on source data quality and need a cutover plan | Which migration guide applies to your source system and how passwords will be handled |
Setting up auto-provisioning step by step
This sequence takes a Zitadel instance from an unconfigured external identity provider to a repeatable first-login flow that creates users, prefills profiles and assigns roles, with a check at each stage so you know what works before you widen access.
Confirm the instance and organization model
Decide which Zitadel instance and organization will receive externally authenticated users, and whether each customer or business unit needs its own organization. Your platform or identity team makes this decision, usually with the application owner, before any configuration starts. Record the instance domain, the organization name and the projects that will hold the roles. You know this step is done when a named administrator can open the target organization in the Zitadel console and the project list matches the design on paper.
Register the external identity provider
Create the external identity provider in the target scope, using the protocol your upstream system supports, such as OIDC or SAML. Register Zitadel as the relying party in the upstream system, then copy the client values or metadata into Zitadel. Keep the provider's exact redirect URI and the scopes it returns in your build notes, because a mismatch here causes most first-login failures. The step is complete when a test login through the provider reaches Zitadel and returns to the login page without an error.
Map claims to profile fields
Document which claims the provider sends for email, given name, family name and any organization or department attribute, and map each one to the Zitadel user profile field it should fill. Confirm the claim names with the upstream administrator by inspecting a real token or assertion from a test account, since names differ between providers and tenants. Record which claims are trusted for identity and which are only informational. You know this step is done when a sample token or assertion contains every claim in your mapping list.
Decide creation versus linking behavior
Choose whether a first login from the external provider should create a new Zitadel user automatically, link to an existing local user with the same verified email, or ask the user to confirm the link. Automatic creation suits a provider that only your tenant controls, while linking fits people who already have a local account. Write down the rule for unverified emails, because an unverified address should never match an existing account. The decision is recorded when your test plan names the expected result for each case.
Write the post-creation Action that assigns roles
Create an Action that runs after external authentication at the post creation point, which Zitadel documents for users who register through an external provider. The Action reads the claims you mapped in the previous step, decides which project role applies, and grants it to the new user in the target organization. Keep the logic small, log each decision, and fail closed when a required claim is missing so no user receives a default role by accident. Your identity engineer should review the code before it is attached to the flow. The step is complete when the Action is saved and listed as active for the flow.
Test first login for a new user
Sign in with a brand-new test account at the external provider and watch the result in Zitadel. Confirm that a user appears in the target organization, that profile fields match the mapped claims, and that the expected project role is granted. Check the Action logs as well, since a silent failure leaves the user without access. Use an account that does not exist locally so the creation path is exercised. The check passes when the user record, profile and role all match the test plan.
Test repeat login and a changed claim
Sign in again with the same test account to confirm that Zitadel links to the existing user rather than creating a duplicate, and that no second role grant appears. Then change a value at the upstream provider, such as a department or a name, and log in again to see whether the profile updates. Verify whether your design expects updates on every login or only at first creation, and confirm the behavior with the team that owns the source data. The step is complete when no duplicate user exists and the profile reflects your documented update rule.
Confirm the rollout and review the audit trail
Before opening the flow to real users, review the Action logs, the user list and the audit events for the test runs, and remove the test accounts from production. Record the final configuration, including the claim mapping, the creation rule and the Action version, so operators can reproduce it. Ask the vendor or your support partner to confirm any detail you cannot verify in your own environment. The step closes when the team signs off the test evidence and the configuration is stored in version control.
Designing claim mapping and role rules by audience
Customer organizations bring their own identity provider, so your Zitadel instance trusts claims from a system you do not administer. Identity claims such as the subject, verified email and domain are the anchors for matching a user, but the roles a customer sends are only as reliable as that customer's directory. Role logic should stay inside each organization, so one customer's group names never grant access in another customer's organization.
- Identity anchor: Match users on the provider's stable subject identifier and a verified email claim, not on a display name or a free-text field.
- Roles from groups: Map only the group or role claims the customer administrator has confirmed for their tenant, and keep those mappings scoped to that organization.
- Unverified attributes: Do not grant privileges from attributes that users can edit in the customer's directory, such as a nickname, title or custom profile field.
- Per-organization rules: Keep role mappings in the Action or configuration for that organization, so a change for one customer does not affect others.
- Default role: Give new users the least-privileged role and require a separate, explicit assignment for administrative access.
Before go-live, ask each customer to confirm claim names, whether email is verified and which groups carry administrative meaning.
Workforce users sign in through your own corporate identity provider, which you usually administer. This gives you stronger control over claims, but it also means that a group claim is only as sound as your directory design. Role mapping should follow your joiner, mover and leaver process so that access changes when employment changes, not only when a user first logs in.
- Authoritative attributes: Prefer the employee identifier, department and group memberships that your HR-driven directory maintains, and confirm which claim carries each one.
- Privileged groups: Map administrative roles only from groups with restricted membership, and never from a free-text attribute that a user or helpdesk can change.
- Refresh on login: Re-evaluate roles at each login so that removing a user from a group removes the matching Zitadel role.
- Separate admin paths: Keep Zitadel instance administration out of workforce role mapping, so an application group cannot grant console access.
- Audit the mapping: Record which group produced which role so reviewers can trace an assignment back to its source.
Confirm the exact claim names and group format with your identity team, since many providers emit group identifiers rather than readable names.
Partner users belong to another company that you do not control, and their identity provider may be configured differently from yours. Partners often need access to a narrow set of applications, so the main risk is over-granting. Treat partner claims as a request for access that your rules approve, not as proof that a partner user should receive a role.
- Scope by organization: Put each partner in its own organization and grant roles only on the projects that partner needs.
- Verify the domain: Confirm that the email domain in the claim belongs to the partner before linking or assigning roles, since a partner tenant can contain accounts you did not expect.
- Limit inherited roles: Do not map a partner's broad administrative group to any role in your instance.
- Time-bound access: Plan how partner access is removed when a contract ends, because a claim that still arrives will keep granting access unless your rules check it.
- Document trust: Record which partner claims you accept and who approved each mapping.
Ask each partner to confirm how their directory populates email verification and group claims before you accept them.
Security risks in auto-provisioning
Provisioning users at first login moves trust from your own directory to whatever identity provider sends the claims. The cards below cover the failure modes that follow from that trust, and for each one the control to put in place before go-live.
Over-broad role assignment from claims
If an Action maps an IdP group or claim straight to a project role, anyone who can influence that claim in the upstream directory can gain access. Map only a short, named list of claim values to roles, and default new users to a no-role or read-only grant. Test with a user who has the widest group membership your IdP can issue, and confirm that the mapping rejects unknown values rather than falling through to a default role.
Zitadel Actions docsDuplicate accounts instead of links
When the provisioning logic creates a new user without checking for an existing account with the same verified email, the same person ends up with two identities, and roles granted to one never reach the other. Decide per provider whether a match on a verified email links to the existing user or stops for review. Run a test where a local user and a federated user share an address, and confirm that only one user record results.
Trust in a misconfigured upstream IdP
Zitadel accepts what a federated provider asserts. A provider with weak MFA, an unverified email attribute or a test tenant wired to production can create privileged users in your instance. Limit each provider to the organization that owns it, restrict which domains it may assert, and require that email verification claims be true before any role is granted. Review provider configuration changes as you would firewall rule changes.
Stale roles after departure
Provisioning at first login only sets roles when the user signs in. A person who leaves the customer or partner keeps the roles granted earlier until someone removes them, and provisioning alone does not revoke them. Define who removes grants on departure, and whether SCIM deprovisioning or a scheduled review handles it. Test the offboarding path by disabling a user in the upstream IdP and checking what access remains in Zitadel.
Personal data in prefilled fields
Prefilling profiles from claims copies whatever the IdP sends, which can include phone numbers, locale, addresses or department data you did not need. Keep the claim list to the attributes your applications use, and document the purpose for each. Ask the IdP team which claims are released by default, and confirm that unused attributes are not stored in user metadata or shown to other users.
Audit gaps in Actions
Logic that creates users and assigns roles inside an Action can run without a clear record of which claims triggered which change. Before go-live, confirm in your own test instance that the Zitadel audit trail records user creation and grant changes made by the flow, and that your log pipeline keeps those events long enough for review. Treat this as something to verify, not an assumption, and record the expected events in your test plan.
Behavior customization guideHow a first external login becomes a Zitadel user
The flow starts when a user picks an external identity provider on the Zitadel login page and is redirected there to authenticate. The provider returns claims to Zitadel, which checks whether an existing user is already linked to that identity. If none is found, Zitadel creates the user and profile, then a post-creation Action runs to assign roles before the session is issued. Check the trust boundary: Zitadel should only trust claims from providers you have configured, and the Action should map only the claims you expect.
Trust boundary between the upstream identity provider and Zitadel during first login.
Limits to confirm in your environment
Auto-provisioning depends on details that vary by Zitadel version, identity provider and configuration. The cards below list what to confirm before go-live, and who in your organization or with your vendor should answer each question.
Profile fields and claims mapped
Confirm which profile fields your Zitadel version maps from IdP claims at first login, including name, email and any custom attributes your applications read. Compare the claim names your identity provider actually emits, such as those in the ID token or userinfo response, against what Zitadel maps by default. Ask your identity provider administrator for a sample token from a test account, and ask your platform team to confirm the mapping against the version you run.
Behavior docsRefresh-on-login scope
Determine whether data refreshed at later logins covers roles and grants as well as profile data. Profile attributes may update on each sign-in while role assignments set by an Action at creation may not be recalculated, which can leave stale access after a group change. Ask your Zitadel administrators to test a role removal in the upstream directory and confirm what changes on the next login.
Missing required claims
Decide what happens when an identity provider omits a claim your provisioning depends on, such as email or a unique subject. Some providers omit optional claims for certain accounts, and a missing email can block account creation or linking. Ask the identity provider owner which claims are guaranteed for every user, and define with your security team whether the login should fail, fall back to a manual step or create a partial profile.
Action execution and error handling
Confirm how a failing Action behaves during external authentication, including whether a thrown error blocks login, leaves the user without a role, or creates a half-provisioned account. Check the Action logs and the retry behavior in your version, and ask your developers to write a test that fails on purpose. Your security team should agree on the default-deny behavior before any role assignment goes live.
SCIM and just-in-time interaction
Confirm how SCIM v2 provisioning and just-in-time creation at first login interact for the same user. If both create or update one account, one source may overwrite the other, and deprovisioning through SCIM may not remove a user already created at login. Ask your identity team to document which source owns each attribute and to test a disable event from the directory.
SCIM v2 docsQuestions teams ask before building auto-provisioning
What drives the cost of auto-provisioning users from an external identity provider?
The cost follows the number of identity providers, how complex the claim mapping is, how many roles you need and how much testing the flows require. Each identity provider adds its own claim shape, attribute quirks and failure cases, so a single Entra ID mapping costs less than four providers with different group formats. A role model with conditional rules, such as roles derived from group membership plus organization context, takes more design and more test cases than a fixed default role. Testing is often the largest variable: every first login, relogin and changed-attribute path should be exercised against real provider accounts. Ask any quote to list providers, claim samples, role rules and test cases separately so you can see which item moves the total.
How long does an auto-provisioning build take?
Duration depends on scope, not on a fixed template. A build covering one provider with a default role and a few profile fields is much shorter than one covering several providers, group-based role assignment, updates on later logins and an audit trail. Timing also depends on how quickly the identity provider administrator can supply claims and test accounts, and on how many review rounds your security and identity teams need. Because most engagements are fixed-scope, the written plan should state the timeline for each deliverable, and you should confirm which dependencies sit on your side before work starts.
What do we need to provide for an auto-provisioning build?
The build needs three things from your side. First, administrator access to each external identity provider, or a named person who can change its application settings and send test logins. Second, claim samples: the exact attributes and group values each provider sends for a few representative users, captured from real logins, including edge cases such as users without a group or with a missing email address. Third, a role matrix that maps each group or claim value to the Zitadel role, grant and organization it should produce. Without the matrix, role logic gets guessed, and guessed role logic is the most common source of rework.
Can our internal team build auto-provisioning in Zitadel themselves?
Yes, if your team has engineers who can write Zitadel Actions, read OIDC and SAML claim formats and test identity flows end to end. The Actions behavior is documented, so the core pattern of hooking into external authentication after user creation is learnable. The harder parts are usually the claim edge cases across providers, safe handling of role changes, and a test plan that proves a user cannot gain roles they should not have. Consider whether your team can own those items after handover, including reviewing changes when an identity provider changes its claims. A partner can cover the build, the tests and the handover documentation, leaving your team with the operating knowledge.
Do we need SCIM for auto-provisioning from an external identity provider?
Not always. Auto-provisioning at first login creates the user when they sign in through the external provider, so it covers people who log in, but it does not create accounts for people who never sign in or remove accounts when someone leaves. Zitadel provides a SCIM v2 service provider interface for standardized provisioning and lifecycle management, which fits when your identity provider pushes user changes ahead of login. Choose SCIM when you need deprovisioning, pre-created accounts or group sync independent of sign-in. Choose login-time provisioning when you only need profiles and roles set for users who authenticate, and confirm with your identity team which lifecycle events must be covered.
How do we keep provisioned data and roles accurate at later logins?
Decide up front which fields are overwritten on every login and which are set only once. Profile fields from the provider, such as name and email, usually refresh on each login, while roles should be recalculated from current claims so that removing someone from a group also removes the role. Plan for a user who loses all mapped groups, since the default behavior must be deliberate, not accidental. The build should also log role changes so a security reviewer can trace when and why access changed. Confirm with each identity provider how long its tokens and claims stay current, because a role change will not appear until the user's next authentication.
What are the main risks of role assignment from external claims?
The main risk is trusting a claim that a user or provider can influence more broadly than intended. If a provider issues a group claim that includes groups from other tenants, or if a mapping matches a loose value such as a partial string, users can receive roles they should not hold. Mitigate this by mapping exact values, restricting each provider to the organization it serves and testing negative cases, such as an account from the wrong domain or a group with a similar name. Also review who can change the mapping itself, because a change to Actions code can affect every login.
Keeping provisioned data accurate over time
Provisioning is a one-time event only at first login. After that, the Action that assigns roles and the profile fields copied from IdP claims need ongoing attention. Start by deciding who owns the Action and who gets alerted when it fails. A failed post-authentication Action can leave a user signed in without the role their application expects, so treat Action failures as an operational incident, not a cosmetic log entry. Confirm how your Zitadel deployment surfaces Action errors (logs, metrics and alerting) and route them to the team that runs the identity service. Test the failure path deliberately: sign in with a test account whose claims are missing or unexpected, and record what the user actually receives.
Role mappings drift whenever the upstream IdP changes. A renamed Entra ID group, a new Okta attribute, or a customer that restructures its directory can silently stop matching the condition in your Action. Keep a register that links each mapped claim value to the Zitadel role it grants, the Action that performs the mapping, and the customer organization it applies to. Review that register whenever an IdP administrator makes a change, and after every upgrade. Sample a few recently provisioned users per organization and compare their roles with the expected values from the IdP. Test the Action in a non-production instance first, and confirm the exact Action hooks and API behavior for your release in the Zitadel customization guide.
Upgrades change the behavior of the login flow, so every upgrade needs a provisioning regression test. Before moving to a newer Zitadel release, the current series is v4.19.5 (released 15 October 2026), replay a fixed set of test logins from each external IdP and check the resulting user records, profile fields and roles. Read the release notes and upgrade notes for your target version on the Zitadel releases page and confirm which Action or login changes apply to you.
Decide early when deprovisioning comes from the IdP through SCIM and when it stays with the login flow. Just-in-time creation at login never removes access when someone leaves a customer, so departures need a separate signal. If the IdP can push lifecycle changes over SCIM v2, let it own deactivation and keep Action-based role assignment for sign-in logic. If it cannot, you need a scheduled reconciliation process and a named owner for it. Confirm with each customer which system is authoritative for leavers.
What DeployOpen scopes and delivers
A provisioning engagement is scoped as one fixed package covering the identity providers, the claims they send and the Zitadel behavior that reads them. The four cards below follow the order of the work, from agreeing the claim contract to handing over the runbook that your team uses after go-live.
Discovery of IdPs and claims
We inventory each external identity provider that will create users, the claims it sends (subject, email, verified email flag, name, group or department attributes) and the cases where a claim is missing or changes. The output is a written claim contract that states which attribute fills which Zitadel profile field, which values are trusted for role decisions and which ones must be ignored. Check that the discovery covers every customer organization, because each one can use a different provider with different claim names.
Identity provider docsZitadel configuration and Actions
We configure the identity provider objects at the right level, instance or organization, and write the Actions that run after external authentication to assign roles and set profile data. Each Action is written against the claim contract, tested for null and unexpected values and kept small enough for your team to read. Confirm with us which Zitadel version the Actions will target, because hook names and behavior can change between releases.
Behavior customization docsTesting first and repeat logins
We test the path a new user takes on first login, where the account is created and prefilled, and the path a returning user takes, where the record is updated and roles are reassessed. Tests also cover a user who signs in with two providers, a user whose claim changes between logins, and a failed Action that must not leave a partial account. Results are delivered as a test matrix with the observed Zitadel user state for each case.
Handover documentation and retainer support
We deliver the runbook: the claim contract, the Action source and version, the provider configuration, the test matrix and the steps to add a new provider or organization. Your team owns these artifacts after handover. If you want continued help, ongoing support, upgrades and retesting after Zitadel releases can be contracted as a retainer, which is quoted separately from the fixed scope.
How DeployOpen delivers Zitadel auto-provisioning
DeployOpen scopes auto-provisioning as a written piece of identity work: which external providers create users, which claims map to profile fields and roles, and how returning users are refreshed. We then build the Actions, test each login path against your providers, and hand over the configuration with documentation your team can run.
How we scope
- Inventory which external identity providers will create accounts and which must only link to existing users.
- Map each IdP claim to a Zitadel profile field or role decision, and record the attributes that must never be overwritten.
- Agree the written scope, deliverables and timeline before work starts, with engagements fixed-scope by default.
How we build
- Configure the Zitadel Actions that assign roles after external authentication, keeping logic small and reviewable.
- Set up test accounts for each provider and login path, including first login, repeat login and changed claims.
- Verify provisioning on a non-production instance before any change reaches the production identity service.
How we hand over
- Document each claim mapping, Action, role assignment and the reason behind it in a handover pack.
- Walk your identity and operations staff through the login flows, failure modes and how to roll back an Action.
- Provide a test checklist your team can rerun after provider changes, Zitadel upgrades or new claim requirements.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover.
- Retainers can cover retesting of provisioning flows when an identity provider changes its claims or token format.
- Ask us to confirm support terms, response expectations and included retesting in the written quote before you commit.

