Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid_grant - oauth#token API v2 #281

Open
vaibhavdeepP opened this issue Mar 1, 2023 · 0 comments
Open

invalid_grant - oauth#token API v2 #281

vaibhavdeepP opened this issue Mar 1, 2023 · 0 comments

Comments

@vaibhavdeepP
Copy link

vaibhavdeepP commented Mar 1, 2023

Using ProductHunt API for authenticating user.

Step 1:
Followed this https://api.producthunt.com/v2/docs/oauth_user_authentication/oauth_authorize_ask_for_access_grant_code_on_behalf_of_the_user and received access_grant as code in the callback URl.

Step 2:
Following this https://api.producthunt.com/v2/docs/oauth_user_authentication/oauth_token_use_the_access_grant_code_you_received_through_the_redirect_to_request_an_access_token

with the payload as

{
    "client_id": "CLIENT_ID",
    "client_secret": "CLIENT_SECRET",
    "redirect_uri": "REDIRECT_URI,
    "code": "jEIysGnrMNFJoNZuCYGFm3luVpAz_5q7x_MAYdcDzz8",
    "grant_type": "authorization_code"
}

This POST request throws this error -

{
    "error": "invalid_grant",
    "error_description": "The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."
}

I've checked the code and REDIRECT_URI matches exactly with the one specified in the API Dashboard.

Why am I still getting this error?

@vaibhavdeepP vaibhavdeepP changed the title invalid_grant - oauth#token invalid_grant - oauth#token API v2 Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant