03-05-2018
02:54
- last edited on
10-14-2018
10:30
by
LanuzaFitbit
03-05-2018
02:54
- last edited on
10-14-2018
10:30
by
LanuzaFitbit
hi guys,
this is my code
session = request.session
service = OAuth2Service(
client_id='********',
client_secret='---------------------------------------------------',
access_token_url='https://api.fitbit.com/oauth2/token',
authorize_url='"https://www.fitbit.com/oauth2/authorize"',
base_url='https://fitbit.com/api/')
params = {'redirect_uri': 'http://127.0.0.1:8000/',
'response_type': 'code'}
url = service.get_authorize_url(**params)
data = {'code': 'response_type',
'grant_type': 'authorization_code',
'redirect_uri': 'http://127.0.0.1:8000/'}
session = service.get_auth_session(data=data)
03-05-2018 05:05
03-05-2018 05:05
Guys any suggestions pls
03-08-2018 02:02
03-08-2018 02:02
guys please, I am really sticked here and unable to move farther
10-24-2018 13:24
10-24-2018 13:24
Hi @access24,
My apologies for the delay with getting back to you. I'm having a hard time following your code. But, the error message states you're not providing a header with the authorization request. Once you receive the authorization code and you're requesting the access token/refresh token pair, you need to specify the following authorization header with the /oauth2/token endpoint.
"Authorization: Basic <Base64 encoded string of your application's client id:secret>"
Information on requesting the access token can be found in the document. Also, I'd recommend trying the OAuth 2.0 Tutorial tool which can be found at the bottom of your application settings on the dev.fitbit.com web site. This tool will show you what information needs to be presented within your code.