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

invalid_request - Invalid redirect_uri parameter value

I have searched through all possible answers here but i am unable to solve this issue. I have registered my app like this

 

Application Website: http://localhost:8080

Organization Website: http://localhost:8080

Callback URL: http://localhost:8080/fitbitauth.xml

 

And then I have following url which i am using to authorize

 

http://www.fitbit.com/oauth2/authorize?response_type=token&client_id=XXXXX&redirectUri=http%3A%2F%2Flocalhost%3A8080%2Ffitbitauth.xhtml&scope=activity%20heartrate%20location%20nutrition%20profile%20settings%20sleep%20social%20weight&expires_in=604800

 But even then I get the same response i.e., invalid redirect_uri ... 

 

Before you you guys say anything that its on localhost, I have tried putting my app on Heroku and still same issue (ofcourse i changed my urls in my app)

 

On heorku i was generating the callback url like 

 

HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
String resultPage = request.getRequestURL().toString() + "fitbitauth.xhtml";

 

Which resulted in http://<app_name>.herokuapp.com/fitbitauth.xhtml

 

Could someone please help me solve this issue.  

Best Answer
0 Votes
1 REPLY 1

@x509 The redirect_uri needs to match the callback url in your app settings, that's why you're seeing invalid redirect_uri error.

 

In your callback url you have ".xml" at the end but looks like your redirect_uri has ".xhtml".

 

 

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer