What you will be able to do
- Analyze the SCIM use cases Snowflake supports (managing users, managing groups as roles, and auditing SCIM API requests) and choose the integration that fits an organization's identity provider
- Create a SCIM security integration for Okta, Microsoft Entra ID or a custom identity provider, with the right provisioner role
- Generate and manage the SCIM access token that the identity provider uses
- Explain why SCIM updates fail for users the provisioner role does not own, and fix it with an ownership transfer
- Audit SCIM API requests with the REST_EVENT_HISTORY table function
Key concept
Provisioner-role ownership — Every user and role that SCIM manages must be owned by the role named in the integration's RUN_AS_ROLE. If any other role owns an object, updates from the identity provider for that object fail.
1.What SCIM does in Snowflake and its use cases
SCIM lets the company directory decide who exists in Snowflake. Snowflake supports SCIM 2.0. The identity provider (Okta, Microsoft Entra ID or a custom IdP) is the source of truth, and Snowflake acts as the service provider that receives the changes. Users map one-to-one to Snowflake users. Groups map one-to-one to Snowflake roles, so a group pushed from Okta becomes a role with the same name.
The Snowflake SCIM API is built for three use cases:
- Managing users. Administrators provision users from the organization's identity provider and keep managing them there, from creation through deactivation.
- Managing groups. Directory groups arrive as Snowflake roles, and the IdP also controls which users are assigned to which role.
- Auditing SCIM API requests. Administrators query
REST_EVENT_HISTORYto check whether the IdP is actually sending updates to Snowflake.
Changes only flow one way. When someone leaves and is deactivated in Okta, the Snowflake user gets DISABLED = TRUE. If an administrator edits a SCIM-managed user directly in Snowflake, that change never goes back to the IdP, and the next push from the IdP can overwrite it. Treat the IdP as the only place where provisioned identities are edited.
SCIM handles provisioning only. It does not handle sign-in. Provisioning does not turn on single sign-on, so users who should log in through the same IdP also need Federated authentication and SSO (SAML2 security integration). Microsoft Entra ID users provisioned through SCIM get no Snowflake password by default, so once SAML is configured they authenticate through SSO.
| Identity provider | SCIM_CLIENT value | Default provisioner role |
|---|---|---|
| Okta | 'OKTA' | OKTA_PROVISIONER |
| Microsoft Entra ID | 'AZURE' | AAD_PROVISIONER |
| Any other SCIM 2.0 IdP | 'GENERIC' | GENERIC_SCIM_PROVISIONER |
The directory you already run decides which integration you build. Okta and Microsoft Entra ID each have a dedicated integration. A company on any other SCIM 2.0 identity provider uses a custom integration, with SCIM_CLIENT = 'GENERIC' and GENERIC_SCIM_PROVISIONER as the owning role. Accounts set up for business continuity are covered as well: Snowflake supports replication, failover and failback of the SCIM security integration from a source account to a target account.
Checkpoint 1 of 9· Check yourself
A company connects Okta to Snowflake with SCIM and pushes users and the Okta group ANALYSTS. Which statement about the result is correct?
In Snowflake, SCIM maps identity-provider groups one-to-one to roles. The IdP is the source of truth, so changes made in Snowflake are not sent back. Provisioning also does not set up SSO, which needs its own SAML2 integration.
“You can provision users and groups (roles) from the identity provider into Snowflake, which functions as the service provider.”Source: docs.snowflake.com
2.Creating the provisioner role and SCIM security integration
Setup on the Snowflake side takes two objects: a narrowly scoped provisioner role and a security integration that runs as that role. The provisioner role needs CREATE USER and CREATE ROLE on the account, and nothing broader. It is then granted to ACCOUNTADMIN so administrators can see what it owns. The integration names the IdP in SCIM_CLIENT and the owning role in RUN_AS_ROLE. The role names are case-sensitive and must be written in capitals inside the quotes.
use role accountadmin;
create role if not exists aad_provisioner;
grant create user on account to role aad_provisioner;
grant create role on account to role aad_provisioner;
grant role aad_provisioner to role accountadmin;
create or replace security integration aad_provisioning
type = scim
scim_client = 'azure'
run_as_role = 'AAD_PROVISIONER';Pointing RUN_AS_ROLE at ACCOUNTADMIN is the wrong way to make provisioning "just work". Every object the IdP creates would be owned by the most powerful role in the account. The scoped-down provisioner exists so that the IdP's reach ends at users and roles. Running the setup itself is a different matter. Creating the integration requires CREATE INTEGRATION, which only ACCOUNTADMIN holds by default. If the setup runs under a less privileged role, choose one with the global MANAGE GRANTS privilege or one that owns every role SCIM will manage. A weaker role causes errors later, when the role hierarchy it can't manage gets in the way.
Two integration properties come up in practice. SYNC_PASSWORD defaults to FALSE and works only for Okta and custom clients, because Entra ID does not support password sync. If Okta does push passwords, users can sign in without going through SSO. You also can't switch a SCIM integration off. Its ENABLED value has no effect, so the only way to stop it is to drop it.
Checkpoint 2 of 9· Fill the gap
This is the Okta version of the Snowflake-side SCIM setup. Which value belongs in the blank so that everything Okta provisions is owned by the right role?
use role accountadmin;
create role if not exists okta_provisioner;
grant create user on account to role okta_provisioner;
grant create role on account to role okta_provisioner;
grant role okta_provisioner to role accountadmin;
create or replace security integration okta_provisioning
type = scim
scim_client = 'okta'
run_as_role = ' ? ';RUN_AS_ROLE names the narrowly scoped provisioner role created for this client, which owns every user and role that SCIM creates. AAD_PROVISIONER is the Entra ID role, and pointing it at ACCOUNTADMIN or SECURITYADMIN would hand those objects to a powerful system role.
Source: docs.snowflake.comCheckpoint 3 of 9· Check yourself
A compliance team won't let administrators run the SCIM setup as ACCOUNTADMIN. Which alternative role is least likely to cause errors later when SCIM manages the role hierarchy?
If the setup can't run as ACCOUNTADMIN, use a role with global MANAGE GRANTS, or one that owns every role SCIM will manage. Weaker roles fail later because they can't manage the role hierarchy. RUN_AS_ROLE should still name the scoped-down provisioner, not ACCOUNTADMIN.
“Use a role with the global MANAGE GRANTS privilege.”Source: docs.snowflake.com
3.Authenticating the identity provider's requests
The IdP authenticates to Snowflake with a bearer token generated from the integration. SYSTEM$GENERATE_SCIM_ACCESS_TOKEN takes the integration name in uppercase and single quotes. It returns a token that is valid for six months. In Okta, the administrator ticks Enable API Integration, pastes the token into API Token and clicks Test API Credentials. Entra ID's provisioning settings take the token the same way. With this token, the IdP calls the short base URL https://<account_identifier>.snowflakecomputing.com/scim/v2/.
SELECT SYSTEM$GENERATE_SCIM_ACCESS_TOKEN('OKTA_PROVISIONING');Revoking a token therefore means DROP INTEGRATION, CREATE SECURITY INTEGRATION and a new token. There is no limit on how many tokens can be generated. Snowflake also accepts two other methods, which both depend on a dedicated service user whose role has USAGE on the integration. One is a programmatic access token restricted to that role. The other is External OAuth, where a third-party authorization server issues tokens to the SCIM IdP and Snowflake acts as the resource server. Both methods call a URL that includes the integration's SCIM_ENDPOINT_ID.
Checkpoint 4 of 9· Put it in order
Put these steps in order to get Okta sending authenticated SCIM requests to Snowflake.
- 1.Create the SCIM security integration with RUN_AS_ROLE set to OKTA_PROVISIONER
- 2.Run SYSTEM$GENERATE_SCIM_ACCESS_TOKEN('OKTA_PROVISIONING') to get a bearer token
- 3.In Okta's provisioning settings, tick Enable API Integration
- 4.Click Test API Credentials and, if it succeeds, save the configuration
- 5.Paste the generated token into the API Token field
The token is generated from the integration, so the integration has to exist first. In Okta, the administrator turns on API integration, pastes the token into API Token, and then tests the credentials before saving.
“For API Token, enter the value generated above from the clipboard. Click Test API Credentials button, and, if successful, save the configuration.”Source: docs.snowflake.com
Checkpoint 5 of 9· Exam question
A company wants Microsoft Entra ID to provision users and groups into its production Snowflake account through SCIM. The role AAD_PROVISIONER already exists and holds CREATE USER and CREATE ROLE on the account. Which TWO actions complete the Snowflake-side setup? Select TWO.(Select 2)
Correct answers: A, B — Create a security integration with TYPE = SCIM, SCIM_CLIENT = 'AZURE' and RUN_AS_ROLE = 'AAD_PROVISIONER' so Entra provisioning runs under that role.; Run SELECT SYSTEM$GENERATE_SCIM_ACCESS_TOKEN('AAD_PROVISIONER') and paste the returned bearer token into the Entra provisioning settings.
- A. The SCIM security integration ties the Azure client type to the provisioning role, and every user or role Entra creates is owned by that role. This is the core object of the SCIM setup.
- B. Entra authenticates to the Snowflake SCIM endpoint with the generated access token, so it must be created and stored in the IdP. The token is returned only when generated.
- C. External OAuth integrations authenticate clients to run SQL, not SCIM provisioning requests. SCIM uses its own security integration and a dedicated token.
- D. Key-pair authentication applies to Snowflake drivers and connectors, and the provisioning role is not a login user. SCIM requests carry the generated bearer token instead.
- E. ACCOUNTADMIN is not a permitted RUN_AS_ROLE for SCIM, and it would be an excessive privilege anyway. A dedicated least-privilege role is required.
4.Managing users and groups from the IdP
With Okta as the IdP, Snowflake receives the full lifecycle. Okta creates users, pushes profile changes, deactivates and reactivates users, and uses Push Groups to create roles and manage role membership. Create roles in Okta first and push them. The provisioner can't manage roles that someone created by hand in Snowflake. Pushing a group does not create its members as users. Users are created when the Snowflake application is assigned to them in Okta.
Existing objects follow different rules. Users created in Snowflake before SCIM can be brought under Okta's management by transferring their ownership to the provisioner role. Their login_name must be set, and their user name will change to match Okta's. Existing roles cannot be brought under Okta's management this way. Only new roles created through Okta are managed.
Ownership is also why updates to some users fail. Suppose Okta updates its own users without trouble, but every update to a few users created by hand fails. Those users are still owned by whichever role created them. Transfer ownership to the provisioner and retry. Giving the provisioner ACCOUNTADMIN, changing the user's default role or recreating the integration does not change who owns the user, so none of those fixes it.
grant ownership on user <username> to role OKTA_PROVISIONER;A few limits affect real rollouts:
- Each SCIM endpoint (
/Users,/Groups) accepts at most 500 concurrent requests per account. Beyond that it returns HTTP 429, which usually happens only during a large first load. - Okta and Entra ID cannot provision nested groups.
- Users created through SCIM get an invitation email within 24–48 hours unless Support opts the account out.
- The provisioner can apply tags through
snowflakeTagsif it hasUSAGEon the tag's schema andAPPLYon the tag. SCIM can also setDEFAULT_SECONDARY_ROLESto'ALL'.
Network access is set on the integration itself. A network policy attached to the SCIM integration overrides the account-level policy. That lets the IdP's IP ranges in without adding them to the policy that controls normal users. The IdP must call the public endpoint, not a .privatelink URL.
alter security integration okta_provisioning set network_policy = <scim_network_policy>;Checkpoint 6 of 9· Fill the gap
Okta updates most users without trouble, but every update fails for a few users that an administrator created by hand in Snowflake before SCIM. Which privilege belongs in the blank so that Okta can manage these users?
grant ? on user <user_name> to role okta_provisioner;SCIM can only update users that the provisioner role owns, so the existing users have to be moved to OKTA_PROVISIONER with GRANT OWNERSHIP. Granting a lesser privilege, such as USAGE or MODIFY, leaves the original creator as owner, and the updates keep failing.
Source: docs.snowflake.comCheckpoint 7 of 9· Exam question
Okta provisioned most users through SCIM, but a handful of accounts were created manually in Snowflake before the integration existed. Okta pushes attribute updates for these users and every request fails, while updates to Okta-created users succeed. What is the MOST appropriate fix?
Correct answer: D — Run GRANT OWNERSHIP ON USER for each manually created user to the SCIM provisioner role, copying current grants, so SCIM can manage those users.
- A. A user's default role only affects the role active at login and has no effect on SCIM management rights. SCIM checks ownership of the user object.
- B. Recreating the integration does not adopt existing users and SYNC_PASSWORD only controls password syncing. Ownership remains with the original creator.
- C. Granting ACCOUNTADMIN does not change which objects SCIM manages and violates least privilege. Ownership by the RUN_AS_ROLE is what matters.
- D. SCIM can only modify users owned by the role named in RUN_AS_ROLE. Transferring ownership of the pre-existing users to that role lets Okta update them.
Sources2
5.Auditing SCIM requests with REST_EVENT_HISTORY
SCIM calls are REST API requests, and Snowflake records them in their own table function: INFORMATION_SCHEMA.REST_EVENT_HISTORY. It takes REST_SERVICE_TYPE => 'scim', the only service type it supports. Use it to check whether the IdP's updates are reaching Snowflake at all, and which of them failed. Each row includes ENDPOINT, METHOD, STATUS (the HTTP result), ERROR_CODE for failed requests, a JSON DETAILS field, CLIENT_IP and ACTOR_DOMAIN, which is the security integration.
USE ROLE ACCOUNTADMIN;
USE DATABASE demo_db;
USE SCHEMA information_schema;
SELECT *
FROM TABLE(rest_event_history(
'scim',
dateadd('minutes',-5,current_timestamp()),
current_timestamp(),
200))
ORDER BY event_timestamp;Two limits shape how you use it. Only ACCOUNTADMIN can get results. The time range must fall within the last 7 days, so yesterday's provisioning run can be checked but last month's cannot. RESULT_LIMIT defaults to 100 rows and goes up to 10,000. Start troubleshooting from both ends: the IdP's log for the Snowflake application shows what was sent, and REST_EVENT_HISTORY shows what arrived and the status each request got.
Checkpoint 8 of 9· Check yourself
An administrator suspects Okta's SCIM updates are not reaching Snowflake at all and wants to see each request that arrived, with its HTTP status and any error code. Where should they look?
SCIM calls are REST API requests, so Snowflake records them in REST_EVENT_HISTORY. Each row has STATUS and ERROR_CODE, which show what arrived and which requests failed. Query and login history don't record these requests, and the integration has no error property that shows them.
“Administrators can query the rest_event_history table to determine whether the identity provider is sending updates (that is, SCIM API requests) to Snowflake.”Source: docs.snowflake.com
Checkpoint 9 of 9· Exam question
A security engineer must audit whether yesterday's Entra ID provisioning calls reached Snowflake and which of them failed. Which approach provides this information?
Correct answer: A — Query the table function INFORMATION_SCHEMA.REST_EVENT_HISTORY with the 'scim' request type, using the ACCOUNTADMIN role.
- A. REST_EVENT_HISTORY returns SCIM REST API calls made to the account, including their status. It is the documented way to monitor SCIM activity.
- B. Failed SCIM requests do not reach SQL execution, so there are no failed statements to find. Successful ones also show only the resulting DDL, not the REST call.
- C. SCIM calls use a bearer token against the REST endpoint and do not create login events. LOGIN_HISTORY would show nothing for them.
- D. SHOW SECURITY INTEGRATIONS lists configuration properties and has no request error history. Request-level details come from REST_EVENT_HISTORY.
Sources
(9)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.https://docs.snowflake.com/en/user-guide/scim-introOfficial docs
“You can provision users and groups (roles) from the identity provider into Snowflake, which functions as the service provider.”
↩︎ What SCIM does in Snowflake and its use cases“User management is a one-to-one mapping from the identity provider to Snowflake.”
↩︎ What SCIM does in Snowflake and its use cases“The Snowflake SCIM API can address the following use cases.”
↩︎ What SCIM does in Snowflake and its use cases“Role management is a one-to-one mapping from the identity provider to Snowflake.”
↩︎ What SCIM does in Snowflake and its use cases“Administrators can query the rest_event_history table to determine whether the identity provider is sending updates”
↩︎ Auditing SCIM requests with REST_EVENT_HISTORY“SCIM roles in Snowflake must own any users or roles that are imported from the identity provider.”
↩︎ Key concept“Administrators can query the rest_event_history table to determine whether the identity provider is sending updates (that is, SCIM API requests) to Snowflake.”
↩︎ Checkpoint - 2.https://docs.snowflake.com/en/user-guide/scim-oktaOfficial docs
“Manage user to role assignments in Snowflake.”
↩︎ What SCIM does in Snowflake and its use cases“For Snowflake, deactivating a user means setting the DISABLED property for the user to TRUE.”
↩︎ What SCIM does in Snowflake and its use cases“The SCIM provisioning process does not automatically enable single sign-on (SSO).”
↩︎ What SCIM does in Snowflake and its use cases“Use a role with the global MANAGE GRANTS privilege.”
↩︎ Creating the provisioner role and SCIM security integration“Always create roles in Okta first and use Push Groups to update Snowflake to ensure Okta and Snowflake can synchronize.”
↩︎ Managing users and groups from the IdP“Existing Snowflake users can be brought under Okta’s management through a transfer of ownership.”
↩︎ Managing users and groups from the IdP“then the update will fail. Transfer the ownership by running the following SQL statement in Snowflake and try again.”
↩︎ Managing users and groups from the IdP“Snowflake supports a maximum of 500 concurrent requests per account per SCIM endpoint”
↩︎ Managing users and groups from the IdP“A network policy applied to a SCIM integration overrides a network policy applied to the entire Snowflake account.”
↩︎ Managing users and groups from the IdP“For API Token, enter the value generated above from the clipboard. Click Test API Credentials button, and, if successful, save the configuration.”
↩︎ Checkpoint - 3.
“You should use custom SCIM integrations for identity providers that are neither Okta nor Microsoft Azure AD.”
↩︎ What SCIM does in Snowflake and its use cases“Snowflake supports replication and failover/failback with the SCIM security integration from the source account to the target account.”
↩︎ What SCIM does in Snowflake and its use cases - 4.
“If you make changes to users and groups in Snowflake directly, the changes don’t synchronize with your identity provider.”
↩︎ What SCIM does in Snowflake and its use cases - 5.https://docs.snowflake.com/en/user-guide/scim-azureOfficial docs
“By default, Microsoft Entra ID users provisioned to Snowflake using SCIM are not assigned a password in Snowflake.”
↩︎ What SCIM does in Snowflake and its use cases - 6.
“Only the ACCOUNTADMIN role has this privilege by default.”
↩︎ Creating the provisioner role and SCIM security integration“Microsoft Entra ID SCIM integrations are not supported because Microsoft Entra ID does not support password synchronization.”
↩︎ Creating the provisioner role and SCIM security integration“A SCIM security integration cannot be disabled.”
↩︎ Creating the provisioner role and SCIM security integration“The values OKTA_PROVISIONER, AAD_PROVISIONER, and GENERIC_SCIM_PROVISIONER are case-sensitive and must always be capitalized.”
↩︎ Exam trap 1 - 7.https://docs.snowflake.com/en/sql-reference/functions/system_generate_scim_access_tokenOfficial docs
“Returns a new SCIM access token that is valid for six months.”
↩︎ Authenticating the identity provider's requests“Note that the integration name is case-sensitive, must be uppercase, and be enclosed in single quotes.”
↩︎ Authenticating the identity provider's requests“To invalidate an access token, you must delete the entire SCIM security integration using the DROP INTEGRATION command.”
↩︎ Exam trap 2“Generating a new SCIM access token does not invalidate an existing token.”
↩︎ Prediction - 8.
“If you are authenticating with a SCIM access token, use the shorter base URL.”
↩︎ Authenticating the identity provider's requests“In this framework, the third-party IdP is the authorization server, the SCIM IdP is the client, and Snowflake is the resource server.”
↩︎ Authenticating the identity provider's requests - 9.
“Only account administrators (i.e. users with the ACCOUNTADMIN role) can obtain query results.”
↩︎ Auditing SCIM requests with REST_EVENT_HISTORY“Error code, if the request was not successful.”
↩︎ Auditing SCIM requests with REST_EVENT_HISTORY“Returns a list of SCIM REST API requests made to Snowflake over a specified time interval.”
↩︎ Exam trap 3