Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.pyc
*.pyo
*.egg-info
*.swp
__pycache__
build
develop-eggs
Expand Down
16 changes: 8 additions & 8 deletions flask_oauthlib/provider/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,11 @@ def authenticate_client(self, request, *args, **kwargs):
log.debug('Authenticate client failed, secret not match.')
return False

confidential = 'confidential'
if hasattr(client, 'confidential'):
confidential = client.confidential
client_type = 'confidential'
if hasattr(client, 'client_type'):
client_type = client.client_type

if client.client_type != confidential:
if client.client_type != client_type:
log.debug('Authenticate client failed, not confidential.')
return False
log.debug('Authenticate client success.')
Expand All @@ -459,11 +459,11 @@ def authenticate_client_id(self, client_id, request, *args, **kwargs):

# authenticate non-confidential client_type only
# most of the clients are of public client_type
confidential = 'confidential'
if hasattr(client, 'confidential'):
confidential = client.confidential
client_type = 'confidential'
if hasattr(client, 'client_type'):
client_type = client.client_type

if client.client_type == confidential:
if client.client_type == client_type:
log.debug('Authenticate client failed, confidential client.')
return False
return True
Expand Down