summaryrefslogtreecommitdiff
path: root/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py
diff options
context:
space:
mode:
Diffstat (limited to 'oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py')
-rw-r--r--oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py b/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py
index 87e8015..931d76c 100644
--- a/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py
+++ b/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py
@@ -105,6 +105,8 @@ class ResourceOwnerPasswordCredentialsGrant(GrantTypeBase):
self.validate_token_request(request)
except errors.OAuth2Error as e:
log.debug('Client error in token request, %s.', e)
+ if e.status_code == 401:
+ headers.update({"WWW-Authenticate": "Basic"})
return headers, e.json, e.status_code
token = token_handler.create_token(request, self.refresh_token, save_token=False)