Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
AdelineA
Partner - Contributor
Partner - Contributor

Snowflake database connection using OAuth 2.0 authentification

Hello,

I'm trying to connect to a Snowflake database using OAuth 2.0 authentification.
I have a Snowflake account with the following caracteristics :
CREATE SECURITY INTEGRATION MY_SNOWSQL_CLIENT2
TYPE = API_AUTHENTICATION
AUTH_TYPE = OAUTH2
ENABLED = TRUE
OAUTH_CLIENT_AUTH_METHOD = CLIENT_SECRET_POST
OAUTH_CLIENT_ID = 'xxxxxxxxxxxxx'
OAUTH_CLIENT_SECRET = 'xxxxxxxxxx'
OAUTH_TOKEN_ENDPOINT = 'https://xxxxxxx.snowflakecomputing.com/oauth/token-request'
OAUTH_ACCESS_TOKEN_VALIDITY = 86400
OAUTH_REFRESH_TOKEN_VALIDITY = 86400
OAUTH_GRANT = 'CLIENT_CREDENTIALS'
;

When I try to connect to my database with Talend, I have this error message :

AdelineA_0-1719838430263.png

 

'java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.databind.JsonNode.asText()" because the return value of "java.util.Optional.orElse(Object)" is null'

Did anyone experienced the same issue ?
Do you know if there is a particular library to install to connect to Snowflake with OAuth 2.0 authentification ?

Best regards,

Adeline

Labels (3)
2 Replies
Jareds
Contributor II
Contributor II

I am having trouble finding documentation for it but, with regard to your Snowflake security integration, what did you use for your redirect URI?

Joni1
Contributor II
Contributor II

We were having this same issue. The problem is that Talend only uses external OAuth. This means you must have an identify provider. When you create the security integration in Snowflake, the type will be external_oauth. You will need to provide snowflake with information from your identify provider. 

This is the link to Snowflake's documentation on setting up an External Oauth Security Integration: https://docs.snowflake.com/en/user-guide/oauth-ext-overview

We found some of the information on the identify providers set ups to be a bit out of date. We had to use our identify provider's documentation to get the application set up correctly.

What helped was adding the tLibraryLoad component to the integration during testing so we could see the exact error message and know what to change. It took a few iterations to get it right. 

Hope this helps!