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, diff --git a/velruse/providers/live.py b/velruse/providers/live.py index 4f9f0a9..a0bc888 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") @@ -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://oauth.live.com/token', - 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))