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

How to redirect back to the mobile application when using Web API?

I am developing a mobile application using React Native. I have developed a separate link that could redirects to the Web API authorization view in a Chrome Custom tab. But when I am authenticated and allowed to access the API how could I get back the authorization token? Because I am giving a separate callback url or if I give a deep link like (myapp://myapp/home) the application can be added to the dev.fitbit applications but when I am calling the api with the callback URI fitbit will redirects to a page saying that the app is not provided valid info. Please hep me with this. Thanks.

Best Answer
0 Votes
3 REPLIES 3

Hi @thisa,

 

So that I can investigate, can you provide me with the error code you are receiving as well as the description of the error? Also, can you let me know which authorization flow you are using for your application? (Implicit or Authorization Code Grant Flow)

 

Looking forward to hearing from you!

Best Answer
0 Votes

I am using the Authorization Grant Flow. In the application registration I have put my callback URL as a deep link back to the app screen("my-demo://demo/home"). When accessing the Fitbit web authorization screen through the URL(https://www.fitbit.com/oauth2/authorize?response_type=code&client_id=22DMQB&redirect_uri=my-demo://d...) it directs to the following message in custom chrome tab view.

 

The app you're trying to connect did not provide valid information to Fitbit. Please report this issue to them.

Developer information: invalid_scope - Invalid scope string : social?redirect_url=my-demo://demo/home

Thanks.

Best Answer
0 Votes

Hi @thisa,

 

Thanks for providing that information to me.

 

After further review of your application, it does not appear that you are using the Authorization Code Grant Flow as your current settings indicate that you are on Implicit Grant Flow. Please know that the authorization URL will differ based on the method of authorization you select.

 

Looking at your authorization URL, it also appears that your link isn't fully HTML encoded. I recommend that you visit your application settings at "https://dev.fitbit.com/apps" and go through the oAuth 2.0 tutorial. There, you'll find the correct formatting of your authorization URL and you'll be able to go through your authorization flow process.

 

I hope this helps! Let me know if you have any other questions in the meantime.

Best Answer