Hi there,
I am having issue with my callback url. I have mentioned the same URL in fitbit app and for my application.
Here is the code snippet...
return this.oauth2.getAuthorizeUrl({
response_type : 'code',
scope : 'heartrate',
redirect_uri : 'https://example.com/gettoken'
});
But it always gives me error after user authentication on Fitbit.
LOG:
{"statusCode":400,"data":"{"errors":[{"errorType":"oauth","fieldName":"redirect_uri","message":"Redirect_uri mismatch: null"}],"success":false}"}
I am unable to figure out the issue. Please help.
Thanks
Answered! Go to the Best Answer.
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Does your redirect_uri value match a URI specified in your app settings on https://dev.fitbit.com ?
Best AnswerHi Jeremiah,
I have cross checked it several times and for sure i have exactly same vaules for redirect_uri and URI specified in my app settings.
Best AnswerCurrently having the same problem. The uri is the same (even copy pasted to make sure)
Best AnswerHi TEvashkevich,
Did you find the solution?
It is getting tough for me and I really need multiple callback URL for the App, but it is not working for the single one.
If i leave the redirect_uri parameter, it works fine. Is it same in your case?
Best AnswerI haven't found a solution yet no.
By leaving do you mean not having it in? Just leaving that part empty? I by all means will give it a try
Best AnswerIf you do not pass the redirect_uri parameter, you will get the access_token after fitbit auth.
see the difference
With uri parameter:
Without uri parameter
https://api.fitbit.com/oauth2/authorize?response_type=code&scope=heartrate&client_id=xxxxxxxx
Hope it will help you.
Best AnswerAh, I was getting the redirect_uri Mismatch in the Authorization step, where we have to POST to
https://api.fitbit.com/oauth2/token
Best AnswerFor the setup of the general OAuth2 stuff (Disregard the Unity Plugin I suggested here as it is not allowed anymore and I described how to do it without the plugin in the other post I link below.)
http://technicalartistry.blogspot.ca/2015/07/oauth2-unity-and-month-of-cursing.html
To change to native (which is needed now)
http://technicalartistry.blogspot.com/2016/01/fitbit-unity-oauth-2-and-native.html
Best Answer
Best Answer