Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Android OAuth2 issue: "Redirect_uri mismatch: null."

Hello,

 

I have a working iOS app using OAuth2, but I can't get an Access Token from my Android App's process flow. I am able to successfully get the Access Code, but when I attempt to exchange it for the Access and Refresh Tokens I get a 400 error that looks like:

 

'{"errors":[{"errorType":"invalid_request","message":"Redirect_uri mismatch: null. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process."}],"success":false}'

 

In both cases it is the same server code that is doing this exchange for the Access Token, so I am not sure what could be going wrong at that point in the process.
Does anyone have a suggestion about what this error message could mean at this point in the process?

 

Thanks,


Chris

Best Answer
0 Votes
2 REPLIES 2

Solved.

 

The callback_uri parameter on the Access Code exchange must match the one from the original authorization. This was empty in my iOS app (due to a bug), and empty on the server to match. When I sent it correctly on the Android App it caused the rest of the process to fail. 

I am I little surprised that this parameter is needed/checked when exchanging the Access Code, but it was a straight forward fix.

Best Answer
0 Votes

If you are still having this error even after trying @ChrisUM solution, don't fret you are on the right course. Just change the parameter from callback_uri to redirect_uri as one of the parameters.

Best Answer
0 Votes