From 5e89b47a38515ddb3bf87b9d627914f396e2f093 Mon Sep 17 00:00:00 2001 From: Arnar Lundesgaard Date: Thu, 4 Sep 2014 11:30:17 +0200 Subject: [PATCH 1/3] Use updated live.com endpoints. --- velruse/providers/live.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/velruse/providers/live.py b/velruse/providers/live.py index 4f9f0a9..60d29ff 100644 --- a/velruse/providers/live.py +++ b/velruse/providers/live.py @@ -75,7 +75,7 @@ def login(self, request): """Initiate a Live login""" scope = request.POST.get('scope', self.scope or 'wl.basic wl.emails wl.signin') - fb_url = flat_url('https://oauth.live.com/authorize', scope=scope, + fb_url = flat_url('https://login.live.com/oauth20_authorize.srf', scope=scope, client_id=self.consumer_key, redirect_uri=request.route_url(self.callback_route), response_type="code") @@ -95,7 +95,7 @@ def callback(self, request): # Now retrieve the access token with the code access_url = flat_url( - 'https://oauth.live.com/token', + '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), From f9df4420358329a7849ab75ab40fc7e7a1871028 Mon Sep 17 00:00:00 2001 From: "Baard H. Rehn Johansen" Date: Thu, 24 Aug 2017 12:39:56 +0200 Subject: [PATCH 2/3] live callback must use post to retrieve access token --- velruse/providers/live.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/velruse/providers/live.py b/velruse/providers/live.py index 60d29ff..a0bc888 100644 --- a/velruse/providers/live.py +++ b/velruse/providers/live.py @@ -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)) From c48d05dbc45201cfb89065ae2bc6554625e36faf Mon Sep 17 00:00:00 2001 From: BaardBouvet Date: Fri, 25 Aug 2017 10:16:25 +0200 Subject: [PATCH 3/3] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2bf6aec..9d1e240 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ README = CHANGES = '' setup(name='velruse', - version='1.1.1', + version='1.1.1a', description=( 'Simplifying third-party authentication for web applications.'), long_description=README + '\n\n' + CHANGES,