Private
Public Access
1
0

API seems to work ok

This commit is contained in:
Sander Roosendaal
2016-12-22 12:21:04 +01:00
parent 2701d330ce
commit 24de5c681d
3 changed files with 18 additions and 7 deletions

View File

@@ -85,9 +85,9 @@ def get_token(code):
client_auth = requests.auth.HTTPBasicAuth(TEST_CLIENT_ID, TEST_CLIENT_SECRET)
post_data = {"grant_type": "authorization_code",
"code": code,
"redirect_uri": TEST_REDIRECT_URI,
"client_secret": TEST_CLIENT_SECRET,
"client_id":TEST_CLIENT_ID,
"redirect_uri": "http://localhost:8000/rowers/test_callback",
"client_secret": "aapnootmies",
"client_id":1,
}
headers = {'Accept': 'application/json',
'Content-Type': 'application/json'}
@@ -99,12 +99,12 @@ def get_token(code):
data=json.dumps(post_data),
headers=headers)
print response.text
token_json = response.json()
thetoken = token_json['access_token']
expires_in = token_json['expires_in']
refresh_token = token_json['refresh_token']
return [thetoken,expires_in,refresh_token]
def make_authorization_url(request):