Jason King
Jason King

Reputation: 41

Snowflake Unsupported Grant Type

I'm running into an issue trying to execute a Token Request for OAuth in Snowflake.

I'm using Postman with a query param of grant_type=authorization_code but the oauth token-request endpoint continually sends back the following response.

{
    "data": null,
    "error": "unsupported_grant_type",
    "code": null,
    "message": "The provided grant type is not supported.",
    "success": false,
    "headers": null
}

Any ideas? Per the documentation this is one of the two supported grant types.

https://docs.snowflake.com/en/user-guide/oauth-custom.html

API URL :

https://example.com/oauth/token-request?grant_type=authorization_code&code=123&redirect_uri=https://localhost.com

Upvotes: 2

Views: 790

Answers (2)

Srinath Menon
Srinath Menon

Reputation: 1642

The values for token generation should be passed under x-www-form-urlencoded section and there the following values should be passed:

redirect_uri
grant_type
code

Under the Header section, following should be passed:

Authorization

The value for this would be:

Basic <base 64 encoded value for clientid:client secret>

The encoded value can be generated from: https://www.base64encode.org or you may generate it using code.

Body of Request

Header Section

Upvotes: 1

Jason King
Jason King

Reputation: 41

The issue is that the Snowflake documentation is incorrect. I will be submitting a ticket to them to get it fixed.

The documentation indicates that you're supposed to include the items as query parameters; they belong in the POST body as per the standard, however.

Upvotes: 2

Related Questions