summaryrefslogtreecommitdiff
path: root/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py
diff options
context:
space:
mode:
Diffstat (limited to 'oauthlib/oauth2/rfc6749/grant_types/client_credentials.py')
-rw-r--r--oauthlib/oauth2/rfc6749/grant_types/client_credentials.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py b/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py
index df5788c..1d9d2df 100644
--- a/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py
+++ b/oauthlib/oauth2/rfc6749/grant_types/client_credentials.py
@@ -52,12 +52,10 @@ class ClientCredentialsGrant(GrantTypeBase):
def __init__(self, request_validator=None):
self.request_validator = request_validator or RequestValidator()
- # NEW-FOR-OPENID
self._token_modifiers = []
def register_token_modifier(self, modifier):
self._token_modifiers.append(modifier)
- # END-NEW-FOR-OPENID
def create_token_response(self, request, token_handler):
"""Return token or error in JSON format.
@@ -84,11 +82,11 @@ class ClientCredentialsGrant(GrantTypeBase):
return headers, e.json, e.status_code
token = token_handler.create_token(request, refresh_token=False)
- # NEW-FOR-OPENID
+
for modifier in self._token_modifiers:
token = modifier(token)
self.request_validator.save_token(token, request)
- # END-NEW-FOR-OPENID
+
log.debug('Issuing token to client id %r (%r), %r.',
request.client_id, request.client, token)
return headers, json.dumps(token), 200