Redirect URI is invalid error
I was following the steps outlined in OAuth 2.0 authorization. While on step 3(exchanging authorization code for access token). I am getting the following error
Body : {"error":"invalid_grant","error_description":"Redirect URI is invalid"}
I did check the Errors page to look up the 'invalid_grant' error, I did not find any reference to it. I am unsure how to proceed further.
Any ideas?
Hi Ajay, if there is more than one redirect URI in your app, you'd want to specify it as the fifth parameter in your call, just like in step one. If it's not the case here we'll be happy to open a Support ticket for you to troubleshoot this!
Hi Sergey,
Thank you for looking into this. I solved this by using the permanent tokens. :D
Thanks,
Ajay
Good thinking! If you decide to return to OAuth 2 later - we'd be happy to talk about it :)
Hello Sergey
I am having the exact same problem as our fellow above.
the query params I am sending are:
'query' => [
'client_id' => $this->clientId,
'client_secret' => $this->secret,
'grant_type' => 'authorization_code',
'code' => $request->code,
'redirect_uri' => 'http://localhost:8000/wriketoken',
],
probably the only thing I am doing in a different way, is that I am opening a new window to the authorization screen... when everything is done on the same window, it works like a charm
What am I doing wrong?
Hi Rafael! Sorry it took a while for us to reply. Have you managed to make it work?
It appears strange, maybe you could check the actual calls you make (maybe through some listener like Fiddler) to see what is changing? What if you try with the permanent access token?
I have the same problem.
The POST https://www.wrike.com/oauth2/token always fails with 400 - bad request error, both in Postman, and in my code:
{ "error": "invalid_grant", "error_description": "Redirect URI is invalid"}
I have only one redirect_uri specified in my app config, which is http://localhost:8000.
I tried to specify it for the previous request (https://www.wrike.com/oauth2/authorize/v4?client_id=<client_id>&response_type=code&redirect_ur= http://localhost:8000) AND also tried to add it as a parameter for https://www.wrike.com/oauth2/token.
This is still not working. I really don't know what i'm missing. The permanent token is working but this is not what i want.
I had this same issue. Even though I only have one Redirect URI in my app, started sending the redirect_uri parameter as @... suggested, and it worked.
Hi MA Lesellier, sorry for the delay here.
Are you still having an issue? If so, let me know and we'll assist further 👍
Elaine Community Team at Wrike Wrike Product Manager En savoir plus sur les fonctionalités et les meilleures pratiques grace à nos Webinaires online
Elaine Wrike Team member En savoir plus sur les fonctionalités et les meilleures pratiques grace à nos Webinaires online
I have this problem. Having only one redirect Uri still failing
https://login.wrike.com/oauth2/authorize/v4?scope=Default%2C%20wsReadOnly%2C%20wsReadWrite&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A10001%2Fauth%2Fcallback%3Fcallback%3D%20https%3A%2F%2Fnewaccount<some_id>.freshdesk.com%2Fa%2Ftickets%2F7%3Fdev%3Dtrue%26product%3Dfreshdesk&state=<state>&client_id=<client_id>
Hi Mariappan S, welcome to the Community! 🤗
I can see that you're discussing this with our Support team currently. Please let me know if I can help you with anything else 👍
Lisa Community Team at Wrike Wrike Product Manager Become a Wrike expert with Wrike Discover
Lisa Wrike Team member Become a Wrike expert with Wrike Discover