01-10-2018 04:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-10-2018 04:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Happy New Year...
Can I get a little help here please.. it might just be the christmas cobwebs .. 2 weeks away from it..
If someone could just take a quick look they might possibly spot something obvious but I can't see it...
This used to work before christmas and now doesn't... trying to get the authorization flow going again...
But I keep getting the Invalid redirect_uri parameter value error....
I redirect as follows :
I do a res.redirect on the following Redirect URL from my node app
(using ngrok to tunnel to my laptop while I'm developing...)
https://www.fitbit.com/oauth2/authorize?scope=activity%20heartrate%20location%20nutrition%20profile%...redirect_uri=https%3A%2F%2F1bae8b38.ngrok.io%2Fcallback&prompt=none&state=&response_type=code&client_id=22CL97
Then when the redirect happens, the login page shows up (cos user has already authorised the app) .. the url becomes as follows... (note the redirect uri looks odd...)
https://www.fitbit.com/login?disableThirdPartyLogin=true&redirect=%2Foauth2%2Fauthorize%3Fclient_id%...edirect_uri%3Dhttps%253A%252F%252F1bae8b38.ngrok.io%252Fcallback%26response_type%3Dcode%26scope%3Dactivity%2Bheartrate%2Blocation%2Bnutrition%2Bprofile%2Bsettings%2Bsleep%2Bsocial%2Bweight%26state%3D
So looks like the encoding is a bit strange eh?
And when I complete the login I finally get the error message:
Developer information: invalid_request - Invalid redirect_uri parameter value
So, something is not right.. but I can't put my finger on it quite yet.. could someone please have a quick look at see if you can spot anything obvious?
Thanks
PJ
Answered! Go to the Best Answer.

Accepted Solutions
01-18-2018 01:59
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-18-2018 01:59
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Just to close this one out.
It WAS christmas cobwebs.
I hadn't got the right redirect URL registered... I had correctly replaced the ngrok url but had forgotten the /callback at the end of it.
I was sending the right (full) url in the request.. but I had the wrong url in the the application manager...
Sorry if I put anyone out over this.

01-18-2018 01:59
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-18-2018 01:59
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Just to close this one out.
It WAS christmas cobwebs.
I hadn't got the right redirect URL registered... I had correctly replaced the ngrok url but had forgotten the /callback at the end of it.
I was sending the right (full) url in the request.. but I had the wrong url in the the application manager...
Sorry if I put anyone out over this.

