Skip to content

Commit

Permalink
mvoe get client inside
Browse files Browse the repository at this point in the history
  • Loading branch information
flaneur2020 authored and lepture committed Apr 1, 2015
1 parent e08b7d7 commit 12b1990
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flask_oauthlib/provider/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,11 +583,12 @@ def client_authentication_required(self, request, *args, **kwargs):
.. _`Section 6`: http://tools.ietf.org/html/rfc6749#section-6
"""

client = self._clientgetter(request.client_id)
if request.grant_type == 'password':
client = self._clientgetter(request.client_id)
return (not client) or client.client_type == 'confidential' \
or client.client_secret
elif request.grant_type == 'authorization_code':
client = self._clientgetter(request.client_id)
return (not client) or client.client_type == 'confidential'
return 'Authorization' in request.headers \
and request.grant_type == 'refresh_token'
Expand Down

0 comments on commit 12b1990

Please sign in to comment.