OAuth2 Trouble with Redirect URL { error: 'invalid_grant', error_description: 'Redirect URI is invalid' }
Hello,
While following the steps outlined in the OAuth 2.0 authorization documentation, I am receiving the following error in Step 3 (Exchanging authorization code for access token):
data: {
error: 'invalid_grant',
error_description: 'Redirect URI is invalid'
}
What I've done so far:
- Ensured that my request URL is free of syntactical errors: "https://login.wrike.com/oauth2/authorize/v4?client_id=${process.env.WRIKE_OAUTH2_CLIENT_ID}&response_type=code&redirect_uri=${process.env.WRIKE_OAUTH2_REDIRECT_URI}"
- The WRIKE_OAUTH2_REDIRECT_URI value above resolves to "https://localhost:3000/auth/wrike/callback" which I have also entered in the API > API Apps configuration screen without any spelling errors
- I originally did not have "https" on localhost, I was using "http". However, I read the paragraph under the "Redirect URI*" section on the app configuration page that says "Provide one or more redirect URIs. Redirect URI should comply with OAuth2 standard requirements and utilize HTTPS protocol. Use “https://localhost” for local development." and updated my local environment to use https accordingly
I attempted to use the permanent access token just to test a few things until I'm able to resolve the error above, and even using the permanent token is resulting in the following error:
data: {
errorDescription: 'Authorization method unknown',
error: 'not_authorized'
}
For the permanent token, I am using a header that looks like: "Authorization: bearer [TOKEN]"
Any help would be greatly appreciated!
Hey Matthew Volk, our Support team have been in touch on this and will be happy to assist further.
If you need anything else let me know 👍
Elaine Community Team at Wrike Wrike Product Manager Become a Wrike expert with Wrike Discover
Elaine Wrike Team member Become a Wrike expert with Wrike Discover