snowflakedb / gosnowflake

Go Snowflake Driver
Apache License 2.0
294 stars 122 forks source link

SNOW-1446031: OAuth authentification failed #1141

Closed SteveGad12345 closed 4 months ago

SteveGad12345 commented 4 months ago

Hi,

I'm using terraform provider snowflake version 0.91 which uses GOSnowflake version 1.10. I got an Authentication FAILED from gosnowflake. I activated the DEBUG and got the url used as shown below. https://[ACCOUNT].snowflakecomputing.com:443/session/v1/login-request?requestId=... When I try this url in my browser, I got an HTTP Status Code 405 with a kind of default error web page. If I only replace the version for v2, I got a HTTP 405, but with a page which displays "Error Method Not Allowed" and with Snowflake logo which is better.

I think that the version could be configurable (it is a const now) or forced to v2.

Additional version:

sfc-gh-dszmolka commented 4 months ago

hello and thank you for raising this issue. Can you please attach the DEBUG logs made with TF_LOG_PROVIDER=1 andSF_TF_GOSNOWFLAKE_LOG_LEVEL=DEBUG envvars set , then running the terraform action which fails for you ? you will need to sanitize the logs from sensitive information; or alternatively you can raise a ticket to Snowflake Support and work 1:1 with a Support engineer if you prefer that.

Asking because the endpoint what you're seeing is normal, and it is also normal that method GET is not allowed (which your browser defaults to) for a login-request endpoint which expects POSTs with login information.

so for now, this is not a bug with the driver or the TF provider, but a simple login issue (perhaps due to misconfiguration) and we would like to troubleshoot it to see if it's otherwise. Thank you in advance!

SteveGad12345 commented 4 months ago

Sorry, I found my error.