Adapter Online Help > TDV Snowflake Adapter > Using OAuth Authentication > Creating a Custom OAuth Integration
 
Creating a Custom OAuth Integration
See Creating a Custom OAuth App for the procedure.
Custom Credentials
This section describes desktop authentication using the credentials for your custom OAuth app. See Creating a Custom OAuth App for more information.
Get an OAuth Access Token
After setting the following, you are ready to connect:
OAuthClientId: Set to the Client ID in your OAuth Integration settings.
OAuthClientSecret: Set to the Client Secret in OAuth your Integration settings.
CallbackURL: Set to the Redirect URL in your OAuth Integration settings.
InitiateOAuth: Set to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
When you connect, the adapter opens the OAuth endpoint in your default browser. Log in and grant permissions to the application. The adapter then completes the following OAuth process:
1. Extracts the access token from the callback URL and authenticates requests.
2. Obtains a new access token when the old one expires.
3. Saves OAuth values in
4. OAuthSettingsLocation to be persisted across connections.
Manually Get an OAuth Access Token
Set the following connection properties to obtain the OAuthAccessToken:
InitiateOAuth: Set to OFF.
OAuthClientId: Set to the Client ID in your OAuth Integration settings.
OAuthClientSecret: Set to the Client Secret in your OAuth Integration settings.
You can then call stored procedures to complete the OAuth exchange:
1. Call the GetOAuthAuthorizationUrl stored procedure. Set the CallbackURL input to the Redirect URI you specified in your app settings.The stored procedure returns the URL to the OAuth endpoint and the PKCEVerifier.
2. Open the URL, log in, and authorize the application. You are redirected back to the callback URL.
3. Call the GetOAuthAccessToken stored procedure. Set the CallbackURL input to the Redirect URI you specified in your app settings. Set the PKCEVerifier input to the value of the PKCEVerifier retrieved form the first step.