Strategy ONE
Configure OAuth Parameters
Starting in Strategy One (March 2025), to connect Snowflake to Microsoft Entra ID and Okta for OIDC sign in, you must configure OAuth parameters.
Determine the OAuth Workflow
Strategy supports two different OAuth workflows in which an OAuth Client can get an access token.
-
Authorization Code: The authorization server can grant the OAuth client an access token on behalf of the user. This method should be chosen for interactive end users to manually fill in login information.
-
Client Credential: The authorization server can grant the OAuth client an access token for the OAuth client itself. This method should be chosen for programmatic, machine-to-machine scenarios.
Configure OAuth Parameters with Microsoft Entra ID (Formerly Known as Azure AD)
Step 1: Create a Snowflake OAuth Resource
Follow Configure the OAuth resource in Microsoft Entra ID to configure the OAuth resource in Microsoft Entra ID. Strategy recommends that you set the Application ID URI and note this value as it will be used in the future.
For testing purposes, the "session:role-any"
role can be set to bypass the role check when it connects to Snowflake using OAuth connections.
Microsoft Entra ID does not allow the same role format for both OAuth workflows. You must use a different role for each method.
For example, you can add two scopes: USER1_ROLE
and USER2_ROLE
. USER1_ROLE
maps to workflow 1 and USER2_ROLE
maps to workflow 2.
Step 2: Create an OAuth Client in Microsoft Entra ID
Follow Create an OAuth client in Microsoft Entra ID to create an OAuth client in Microsoft Entra ID.
-
For the Authorization Code workflow, refer to step 13 of Create an OAuth client in Microsoft Entra ID to choose Delegated Permissions.
-
For the Client Credential workflow, refer to step 14 Create an OAuth client in Microsoft Entra ID to choose Application Permissions.
Redirect URLS
The following steps in this section are only required if you are using the Authorization Code workflow. If you are following the Client Credential workflow, the following steps in this section are not required.
In the Authentication Page of the OAuth client in the Azure Portal, add the following required redirect URLs:
To integrate with Strategy using OAuth:
Web
https://<ISERVER_HOST>/MicroStrategyLibrary/auth/DIOAuthRedirect.jsp
To integrate with Strategy Library or Workstation using OIDC:
Web
https://<ISERVER_HOST>/MicroStrategyLibrary/auth/DIOAuthRedirect.jsp
https://<ISERVER_HOST>/MicroStrategyLibrary/static/oidc/success.html
https:// <ISERVER_HOST> /MicroStrategyLibrary/auth/oidc/login
Mobile and desktop applications
http://127.0.0.1
com.microstrategy.hypermobile://auth
com.microstrategy.dossier.mobile://auth
Step 3: Collect Azure AD Information for Snowflake
Follow Collect Azure AD information for Snowflake to collect Azure AD information for Step 4 of this topic. You will need the following information:
-
<AZURE_AD_ISSUER>
from the Federation metadata document. -
<AZURE_AD_JWS_KEY_ENDPOINT>
from the OpenID Connect metadata
If you used and noted the Application ID URI in Step 1: Create a Snowflake OAuth Resource, collect that value. This will be used as the <SNOWFLAKE_APPLICATION_ID_URI>
value in step 4 of this topic.
Step 4: Create a Security Integration in Snowflake
Authorization Code Workflow
Execute the following SQL to create a security integration. For more information, see Create a Security Integration in Snowflake.
create security integration external_oauth_azure_2
type = external_oauth
enabled = true
external_oauth_type = azure
external_oauth_issuer = '<AZURE_AD_ISSUER>'
external_oauth_jws_keys_url = '<AZURE_AD_JWS_KEY_ENDPOINT>'
external_oauth_audience_list = ('<SNOWFLAKE_APPLICATION_ID_URI>')
external_oauth_token_user_mapping_claim = 'upn'
external_oauth_snowflake_user_mapping_attribute = 'login_name';
If you do not use the Application ID URI, create a security integration with audiences using the Snowflake Account URL (for example, <account_identifier>.snowflakecomputing.com
).
Client Credential Workflow
Execute the following SQL to create a security integration using a Snowflake Account Admin user.
create security integration EXTERNAL_OAUTH_AZURE
type = external_oauth
enabled = true
external_oauth_type = azure
external_oauth_issuer = '<AZURE_AD_ISSUER>'
external_oauth_jws_keys_url = '<AZURE_AD_JWS_KEY_ENDPOINT>'
external_oauth_audience_list = ('<SNOWFLAKE_APPLICATION_ID_URI>')
external_oauth_token_user_mapping_claim = 'sub'
external_oauth_snowflake_user_mapping_attribute = 'login_name';
Considerations
If you use session:role-any
, external_oauth_any_role_mode
should be enabled. Using Authorization Code workflow as an example:
create security integration external_oauth_azure_2
type = external_oauth
enabled = true
external_oauth_type = azure
external_oauth_issuer = '<AZURE_AD_ISSUER>'
external_oauth_jws_keys_url = '<AZURE_AD_JWS_KEY_ENDPOINT>'
external_oauth_audience_list = ('<SNOWFLAKE_APPLICATION_ID_URI>')
external_oauth_token_user_mapping_claim = 'upn'
external_oauth_any_role_mode= 'ENABLE'
external_oauth_snowflake_user_mapping_attribute = 'login_name';
Only one security integration can be created with the same Azure AD Issuer. If you want to use both the workflows, update the security integration using the following snippet:
Alter security intergration external_oauth_azure set EXTERNAL_OAUTH_TOKEN_USER_MAPPING_CLAIM = ('upn','sub');
Step 5: Create/Alter a User for Snowflake OAuth Login
Authorization Code
Create a user for the OAuth login to Snowflake. For example, you can use the following snippet:
CREATE USER Taylor PASSWORD = 'password' LOGIN_NAME = 'taylor@strategy.com' DISPLAY_NAME = 'Taylor' FIRST_NAME = 'Taylor' LAST_NAME = 'Taylor' EMAIL = 'taylor@strategy.com' DEFAULT_ROLE = "PUBLIC" DEFAULT_WAREHOUSE = 'TEST_WH' DEFAULT_NAMESPACE = 'TEST' MUST_CHANGE_PASSWORD = FALSE;
The login_name
should match the actual Azure AD upn for user authentication.
Client Credential
-
Request the OAuth Access Token
Prepare the cURL command to request the Access Token using the CC grant. For example, credentials of the client.
Execute the command in the terminal using the following template:
Copycurl -X POST -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" \
--data-urlencode "client_id=<Client_ID>" \
--data-urlencode "client_secret=<Client_Secret>" \
--data-urlencode "grant_type=client_credentials" \
--data-urlencode "scope=<Scope>/.default" \
'<Token_Endpoint>'After successful execution, the following response displays:
Copy{
"token_type":"Bearer",
"expires_in":3599,
"ext_expires_in":3599,
"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjVCM25SeHRRN2ppOGVORGMzRnkwNUtmOTdaRSIsIm.......FTU5nctRpmaA"
} -
Decode the OAuth Access Token
Copy the
access_token
value and decode it on an online decoder of your choice (for example, jwt.ms). It will provide the details in the token, such as:Copyhttps://sts.windows.net/4c481368-xxxx-xxxx-xxxx-3844f846d0ca/",
"oid": "3d63d2ef-abb5-4029-bea5-c72c0652895d",
"rh": "1.AYIAaBNITGZFAUGcDDhE-EbQyi7MprcWchxIhpzKmCKYJ8CCAACCAA.",
"roles": [
"session:role:ANALYST"
],
"sub": "3d63d2ef-abb5-4029-bea5-c72c0652895d",
"tid": "4c481368-xxxx-xxxx-xxxx-3844f846d0ca",
"uti": "LcudwZszi06vgEbDZmqUAA",
"ver": "1.0"
}.[Signature]Note the value of
sub
. -
Create a system user for the OAuth login to Snowflake for client credential, such as the following.
Set
LOGIN_NAME
to thesub
value you noted above.CopyCREATE USER SNOWSQL_OAUTH_USER
LOGIN_NAME = '3d63d2ef-abb5-4029-bea5-c72c0652895d'
DISPLAY_NAME = 'SnowSQL OAuth User for client credential' COMMENT = 'A system user for SnowSQL client to be used for OAuth based connectivity';
Step 6 (Optional): Request the OAuth Access Token and Validate
Prepare the cURL command to request the Access Token using the CC grant. For example, credentials of the client.
curl -X POST -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" \
--data-urlencode "client_id=<Client_ID>" \
--data-urlencode "client_secret=<Client_Secret>" \
--data-urlencode "grant_type=client_credentials" \
--data-urlencode "scope=<Scope>" \
'<Token_Endpoint>'
Copy the token from the response and validate it in Snowflake using the following command:
SELECT SYSTEM$VERIFY_EXTERNAL_OAUTH_TOKEN('<Access_Token>');
After successful execution, the following response displays:
Token Validation finished.
{
"Validation Result":"Passed",
"Issuer":"https://sts.windows.net/91ccae45-xxxx-xxxx-xxxx-xxxxxxxxxxxx/",
"Extracted User claim(s) from token":"4c99a1d6-50ce-4e7d-9cc2-429c26d613df"
}
Step 7: Collect Azure AD Information for Strategy
You need the following information:
-
<CLIENT_ID>
and<CLIENT_SECRET>
noted in step 3 when creating an OAuth client. -
<TENANT_ID>
from the Overview page of the OAuth Client App from the Azure Portal. -
Find the value of Scopes in the OAuth Resource App's Expose an API page in the Azure Portal and click Copy to clipboard.
The
<SCOPE>
values should be in the following formats:-
<SNOWFLAKE_APPLICATION_ID_URI>/session:role:<role_name>
-
<SNOWFLAKE_APPLICATION_ID_URI>/session:role-any
-
-
Download the manifest file from the Snowflake OAuth client app in the Azure portal. In the left navigation, click Manifest under Manage and click Download.
Configure OAuth Parameters with Okta
Authorization Code Workflow Setup
Step 1: Create an Okta Application
-
Log in to Okta.
-
In the Navigation pane, under Applications, click Applications.
-
Click Create App Integration.
-
Choose the OIDC - OpenID Connect sign-in method and choose Native Application.
-
Click Next.
-
Type a name for the integration and choose the Refresh Token and Token Exchange grant types.
-
Add your sign-in redirect URIs.
-
Choose the Allow everyone in your organization to access controlled access.
-
Click Save.
Step 2: Edit the OpenID Connect ID Token
-
Go to Sign On in your newly created application.
-
In OpenID Connect ID Token, click Edit.
-
In the Issuer drop-down list, choose your Okta URL.
-
Click Save.
Step 3: Grant API Scopes
-
Go to Okta API Scopes in your newly created application.
-
Click Grant next to the following scopes:
-
okta.apps.read
-
okta.groups.read
-
okta.user.read
-
Step 4: Create an API (Authentication Server)
-
In the Navigation pane, under Security, click API.
-
Click Add Authorization Server.
-
Type a Name and Audience. For example, the Audience can be a Snowflake account URL.
-
Click Save.
Step 5: Update the API Issuer
-
Go to Settings in your newly created API.
-
Click Edit.
-
In the Issuer drop-down list, choose your Okta URL.
-
Click Save.
Step 6: Add a session:role-any Scope
-
Go to Scopes in your newly created API.
-
Click Add Scope.
-
In Name, Display phrase, and Descriptions, type
session:role-any
. -
Click Create.
Step 7: Create an Access Policy and Rule
-
Go to Access Policies in your newly created API.
-
Click Add Policy.
-
Type a name and description. Optionally edit Assign to.
-
Click Create Policy.
-
Click Add rule.
-
Type your preferred rule options and ensure Authorization Code and Token Exchange are selected.
-
Click Create rule.
Step 8: Enable the Okta Integration in Snowflake
-
Open the Authentication server page and locate the
<AUDIENCE>
value and Metadata Document URL (for example,https://dev-XXXXXXXX.okta.com/oauth2/XXXXXXXXXXXXXXXXX/.well-known/oauth-authorization-server
). -
Open the Authentication server Metadata Document and locate the
issuer
andjwks_uri
values. -
Run the following SQL query in Snowflake:
CopyCREATE OR REPLACE SECURITY INTEGRATION external_oauth_demo
type = external_oauth
enabled = true
external_oauth_type = 'okta'
external_oauth_any_role_mode = 'ENABLE'
external_oauth_issuer = '<ISSUER>'
external_oauth_jws_keys_url = '<JWKS_URI>'
external_oauth_audience_list = ('<AUDIENCE>')
external_oauth_token_user_mapping_claim = 'sub'
external_oauth_snowflake_user_mapping_attribute = 'login_name';Replace
<ISSUER>
with the issuer value and<JWKS_URI>
with the jwks_uri value you located in the Metadata page.
Step 9: Create/Alter a User for Snowflake OAuth Login
Create a user for the OAuth login to Snowflake such as:
CREATE USER Taylor PASSWORD = 'password'
LOGIN_NAME = 'taylor@microstrategy.com' DISPLAY_NAME = 'Taylor' FIRST_NAME = 'Taylor' LAST_NAME = 'Taylor'
EMAIL = 'taylor@microstrategy.com'
DEFAULT_ROLE = "PUBLIC" DEFAULT_WAREHOUSE = 'TEST_WH' DEFAULT_NAMESPACE = 'TEST' MUST_CHANGE_PASSWORD = FALSE;
LOGIN_NAME
must match the Okta sub for user authentication.
Step 10: Collect Okta Information for Strategy
Note the following Okta information to use in Strategy:
-
Authentication Server Metadata URI from Step 8.
-
<CLIENT_ID>
from Step 1. -
<OAUTH_URL>
is theauthorization_endpoint
value in the Authentication Server Metadata Document. -
<TOKEN_URL>
is thetoken_endpoint
value in the Authentication Server Metadata Document. -
<ISSUER>
is thetoken_endpoint
value in the Authentication Server Metadata Document. -
<SCOPE>
should be in a format similar to the following:offline_access openid email profile session:role-any
Client Credential Workflow Setup
Step 1: Create an Okta Application
-
Log in to Okta.
-
In the Navigation pane, under Applications, click Applications.
-
Click Create App Integration.
-
Choose the API Services sign-in method and click Next.
-
Type a name for the application integration and click Save.
-
Note the Client ID and Client Secret. These values will be used as for
<OKTA_OAUTH_CLIENT_ID>
and<OKTA_OAUTH_CLIENT_SECRET>
. -
Click Edit in General Settings.
-
Clear Proof of possession and leave Token Exchange unselected.
Step 2: Create an API (Authentication Server), Update API Issuer, and Add a Scope
-
In the Navigation pane, under Security, click API.
-
Click Add Authorization Server.
-
Type a Name and Audience. For example, the Audience can be a Snowflake account URL.
-
Click Save.
-
Go to Settings in your newly created API.
-
Click Edit.
-
In the Issuer drop-down list, choose your Okta URL.
-
Click Save.
-
Go to Scopes in your newly created API.
-
Click Add Scope.
-
In Name, Display phrase, and Descriptions, type
session:role-any
. -
Click Create.
Step 3: Create an Access Policy and Rule
-
Go to Access Policies in your newly created API.
-
Click Add Policy.
-
Type a name and description. In Assign to, enter the previously created application.
-
Click Create Policy.
-
Click Add rule.
-
Type a name for the rule.
-
Ensure Client Credentials is the only Grant type selected. The other options must be cleared.
-
In Scope requested, select The following scopes.
-
Type the scopes you defined in Step 2: Create an API (Authentication Server), Update API Issuer, and Add a Scope and select them from the list.
-
Click Create Rule.
Step 4: Collect Okta Information for Snowflake and Strategy
-
Open the Authentication server page and note the
<AUDIENCE>
value. -
Open the Metadata Document URL (for example,
https://dev-XXXXXXXX.okta.com/oauth2/XXXXXXXXXXXXXXXXX/.well-known/oauth-authorization-server
) and note theissuer
,authorization_endpoint
,token_endpoint
, andjwks_uri
values. -
Go to Token Preview.
-
Select your OAuth Client, Grant Type, and Scopes to generate a preview of a decoded JWT token.
-
Ensure the
scp
claim matches your scopes and note thesub
value. Thesub
value is used for thelogin_name
for the user the client will authorized against in Snowflake.
Step 5: Collect Okta Information for Strategy
Ensure you noted the following Okta information to use in Strategy:
-
OKTA_OAUTH_CLIENT_ID
-
OKTA_OAUTH_CLIENT_SECRET
-
OKTA_ISSUER
-
Metadata URI
-
JWKS_URI
-
sub
-
AUTHORIZATION_ENDPOINT
-
TOKEN_ENDPOINT
Step 6: Create the Integration and User in Snowflake
-
Create the security integration by running the following SQL query in Snowflake:
CopyCREATE OR REPLACE SECURITY INTEGRATION external_oauth_demo
type = external_oauth
enabled = true
external_oauth_type = 'okta'
external_oauth_any_role_mode = 'ENABLE'
external_oauth_issuer = '<ISSUER>'
external_oauth_jws_keys_url = '<JWKS_URI>'
external_oauth_audience_list = ('<AUDIENCE>')
external_oauth_token_user_mapping_claim = 'sub'
external_oauth_snowflake_user_mapping_attribute = 'login_name'; -
Create the Snowflake programmatic user by running the following SQL query in Snowflake:
CopyCREATE USER SNOW_CC_OKTA LOGIN_NAME = '<sub>'
DISPLAY_NAME = 'OAuth User for client credential on okta'
COMMENT = 'A system user for client to be used for OAuth based connectivity';