Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
live callback must use post to retrieve access token
  • Loading branch information
BaardBouvet committed Aug 24, 2017
commit f9df4420358329a7849ab75ab40fc7e7a1871028
17 changes: 9 additions & 8 deletions velruse/providers/live.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,15 @@ def callback(self, request):
provider_type=self.type)

# Now retrieve the access token with the code
access_url = flat_url(
'https://login.live.com/oauth20_token.srf',
client_id=self.consumer_key,
client_secret=self.consumer_secret,
redirect_uri=request.route_url(self.callback_route),
grant_type="authorization_code",
code=code)
r = requests.get(access_url)
access_url = 'https://login.live.com/oauth20_token.srf'
access_data = {
"client_id": self.consumer_key,
"client_secret": self.consumer_secret,
"redirect_uri": request.route_url(self.callback_route),
"grant_type": "authorization_code",
"code": code
}
r = requests.post(access_url, data=access_data)
if r.status_code != 200:
raise ThirdPartyFailure("Status %s: %s" % (
r.status_code, r.content))
Expand Down