Skip to content

Identity Federation in Snowflake using External OAuth

5 min read · Updated 9 Nov 2026

Federated identity simplifies the login process by establishing a trust relationship between services.

In this case, Astrato acts as an identity provider, allowing users to connect to Snowflake using their access token.

With OAuth, Astrato can securely delegate access to Snowflake while verifying the user’s identity and sharing relevant attributes.

Instead of logging in directly to Snowflake, users only need to authenticate with Astrato. Astrato generates an access token that contains user attributes and sends it to Snowflake. The token is verified to ensure it originated from a trusted relationship with Astrato, making the authentication process more streamlined and secure.

    • Snowflake ACCOUNTADMIN role

    • Astrato Administrator or Owner role

    • Astrato uses email as a user’s unique identifier.

    • Each Astrato user that wants to use identity federation needs to exist on a Snowflake side with the same email address.

    • Astrato utilizes OAuth session:role-any, and it needs users to have a default Snowflake role defined.

    • Astrato requires users to have a default warehouse defined in Snowflake.

  1. To establish an identity federation between Snowflake and Astrato, it is necessary to configure both services accordingly. To do so, as an Astrato Administrator, navigate to Administration ➝ Enterprise Connection ➝ Identity federation, then click Add provider and select Snowflake.
    ​

    Enterprise Connection page on the Identity federation tab, saying no Service Provider is configured, with New Provider buttons

  2. On the Configuration tab, you can find the default settings that must be used to enable external security integration in Snowflake.
    ​

    Snowflake Configuration tab listing JSON Web Key Sets, Astrato Issuer, RS512, scope mapping attribute scp, scope session, claim sub

  3. To create a Security integration in Snowflake, you will use the values found in Astrato’s Configuration tab.

    external_oauth_issuer - value from Astrato Issuer above

    external_oauth_audience_list - snowflake account url that would respect the tokens

    external_oauth_jws_keys_url - value from JSON Web Key Sets above

    external_oauth_scope_mapping_attribute - value from Scope mapping attribute above

    external_oauth_token_user_mapping_claim - value from User mapping claim above

    external_oauth_any_role_mode - Astrato uses session:role-any by default

    external_oauth_snowflake_user_mapping_attribute - Astrato requires user’s email
    (for example in this case we’ll use the Login Name as mapping attribute

    Snowflake Edit User dialog with the Login Name field filled in and a default role and warehouse selected

    ​

  4. Log in to Snowflake with a user who has an ACCOUNTADMIN role privilege or any other privileged user to create security integration.
    Execute the SQL statement below.
    Note: For more security-related options like allowed Snowflake roles and others, see Snowflake docs
    ​

    CREATE OR REPLACE SECURITY INTEGRATION EXTERNAL_OAUTH_FOR_ASTRATO_ROLE_ANY
    TYPE = EXTERNAL_OAUTH
    ENABLED = TRUE
    EXTERNAL_OAUTH_TYPE = CUSTOM
    EXTERNAL_OAUTH_ISSUER = 'https://app.astrato.io/tenant/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
    EXTERNAL_OAUTH_AUDIENCE_LIST = ('https://xxxxxx.europe-west2.gcp.snowflakecomputing.com')
    EXTERNAL_OAUTH_JWS_KEYS_URL = 'https://app.astrato.io/auth/proxy/tenant/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/fed/jwks.json'
    EXTERNAL_OAUTH_SCOPE_MAPPING_ATTRIBUTE = 'scp'
    EXTERNAL_OAUTH_TOKEN_USER_MAPPING_CLAIM = 'sub'
    EXTERNAL_OAUTH_ANY_ROLE_MODE = 'ENABLE'
    -- Alternatively, map to 'login_name' instead of 'email_address'.
    EXTERNAL_OAUTH_SNOWFLAKE_USER_MAPPING_ATTRIBUTE = 'email_address';
  5. Once it’s created in Snowflake, return to the Add provider panel in Astrato, where Snowflake is still selected, and open its Setup tab.
    ​

    Snowflake Setup tab with Display Name set to Snowflake GK, a Service account URL field and a Create button

    • Display name - type in here any name that will let you recognize your configuration

    • Service account URL - type in here your Snowflake account url like: https://xxxxxx.europe-west2.gcp.snowflakecomputing.com
      ​Learn how to find your account URL.

    Click Create
    ​

  6. Once the Security integration is created, you can obtain a testing access token by clicking the “Generate test token” button.
    ​

    Snowflake GK Setup tab with a Generate button under Generate test token, plus General, Signing key and Danger zone sections

  7. Verify the token by copying its content and running this code in Snowflake.
    ​select SYSTEM$VERIFY_EXTERNAL_OAUTH_TOKEN('your token')
    If the token is valid you should see this result:
    ​

    Snowflake query result showing SYSTEM$VERIFY_EXTERNAL_OAUTH_TOKEN returning Token Validation finished with Validation Result Passed

    ​
    For debugging token errors, see documentation: Snowflake External OAuth Errors
    ​

  8. After completing the setup process, you can use your identity federation in an Astrato data connection. Navigate into Data & AI ➝ Data Connections and select New connection.
    ​

    Data page on the Data Connection tab with an empty connections table and a New connection button

  9. Select Snowflake. The panel title changes to New Snowflake connection. The screenshot below shows an earlier version of the source list.
    ​

    Create connection dialog with tiles for Snowflake, Google Sheets, PostgreSQL, BigQuery, Dremio, Redshift and Databricks, Snowflake highlighted

    ​

  10. Under Authentication, choose Sign in with Snowflake. Then choose your identity federation from the OAuth connection list. Its entry shows the display name you gave it in step 5, such as Snowflake GK.
    An identity federation needs no Sign in: Astrato issues the token itself, and the form says “Astrato issues this identity federation’s token. You can validate the connection directly.” If the form says instead that the identity federation has not confirmed the required authorization, ask your workspace administrator to check its access.
    The screenshot below shows an earlier version of this form, which had an Oauth option and a Test connection button.
    ​

    Connect to Snowflake form with Oauth selected, the account url dropdown showing Federated: Snowflake GK and a Test connection button

  11. If your workspace offers a Deployment Region, choose one. Then select Validate Connection. When it succeeds, a Validation result section says “Connected to Snowflake in n ms.”

  12. Under Session, Role and Warehouse read User default: each person queries with their own default role and warehouse in Snowflake. To set them for everyone instead, select Advanced beside the Session heading and choose them. Under Data to use, choose the Database.

  13. Under Name, change the Connection name to something people will recognise, then select Save connection. The panel shows Connection created. If it offers a Schema, choose one or leave it as Choose later, then select Finish.