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

How to do Authenticate the user from iOS App?

ANSWERED

HI,

I am new fitbit. I have created user account in fitbit and also i have created one application on the same. 

when i authendicate(From ios app) my user credential through oAuth 2 url (

https://www.fitbit.com/oauth2/authorize?response_type=code&client_id=227RF9C&redirect_uri=http%3A%2F...

) I am getting the below error

 

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

Developer information: unauthorized_client - Invalid client_id

 

please let me know any thing worng in redirect_uri

 

If any one help me on this

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

The error tells you the problem. The client_id value is not valid. There is no client registered with the id of 227RF9C.

View best answer in original post

Best Answer
0 Votes
3 REPLIES 3

The error tells you the problem. The client_id value is not valid. There is no client registered with the id of 227RF9C.

Best Answer
0 Votes

made mistake in client_id, Now its working fine.  My redirect URI is https://localhost. after authendication its going to that URI, When i response came from the server automatically my ios app has to response. how can i achieve this? and some more question are

 

My question is

1. How can i do the authentication through ios app?

2. How can i read the my health information through ios app?

3. Is it possible update my health information from my ios app?

Best Answer
0 Votes

Fitbit uses has a fairly common implementation of OAuth 2.0. You should search for iOS specific information on how to use OAuth 2.0 with Obj-C or Swift. Someone recently shared their iOS code.

 

You need to implement an OAuth 2.0 authorization flow. This is the part that obtains consent for your app to access a specific person's data.

 

Then, you'll need to make HTTP requests for that person's data using an OAuth 2.0 Authorization header.

Best Answer
0 Votes