summaryrefslogtreecommitdiff
path: root/oauthlib/oauth2/rfc6749/grant_types
diff options
context:
space:
mode:
authorJoel Stevenson <jstevenson@bepress.com>2016-04-26 11:15:10 -0700
committerJoel Stevenson <jstevenson@bepress.com>2016-04-26 11:15:10 -0700
commitdae2c64b66c530e50c0a15bdd6cab072c733af85 (patch)
treedb522c9e17fa78d71796e00a7e977b971cbe8736 /oauthlib/oauth2/rfc6749/grant_types
parentbd3dcb88fb957bfa3e43409af8b59245e88d2163 (diff)
downloadoauthlib-dae2c64b66c530e50c0a15bdd6cab072c733af85.tar.gz
Remove some comments related to new code for OIDC feature.
Diffstat (limited to 'oauthlib/oauth2/rfc6749/grant_types')
-rw-r--r--oauthlib/oauth2/rfc6749/grant_types/authorization_code.py2
-rw-r--r--oauthlib/oauth2/rfc6749/grant_types/client_credentials.py6
-rw-r--r--oauthlib/oauth2/rfc6749/grant_types/refresh_token.py6
-rw-r--r--oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py6
4 files changed, 6 insertions, 14 deletions
diff --git a/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py b/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
index d35b55a..a47d01a 100644
--- a/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
+++ b/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
@@ -122,8 +122,6 @@ class AuthorizationCodeGrant(GrantTypeBase):
def register_token_modifier(self, modifier):
self._token_modifiers.append(modifier)
- # END-NEW-FOR-OPENID
-
def create_authorization_code(self, request):
"""Generates an authorization grant represented as a dictionary."""
grant = {'code': common.generate_token()}
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
diff --git a/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py b/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py
index 864ef06..209b8a2 100644
--- a/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py
+++ b/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py
@@ -25,12 +25,10 @@ class RefreshTokenGrant(GrantTypeBase):
def __init__(self, request_validator=None, issue_new_refresh_tokens=True):
self.request_validator = request_validator or RequestValidator()
self.issue_new_refresh_tokens = issue_new_refresh_tokens
- # NEW-OPENID
self._token_modifiers = []
def register_token_modifier(self, modifier):
self._token_modifiers.append(modifier)
- # END-NEW-OPENID
def create_token_response(self, request, token_handler):
"""Create a new access token from a refresh_token.
@@ -64,11 +62,11 @@ class RefreshTokenGrant(GrantTypeBase):
token = token_handler.create_token(request,
refresh_token=self.issue_new_refresh_tokens)
- # NEW-OPENID
+
for modifier in self._token_modifiers:
token = modifier(token)
self.request_validator.save_token(token, request)
- # END-NEW-OPENID
+
log.debug('Issuing new token to client id %r (%r), %r.',
request.client_id, request.client, token)
return headers, json.dumps(token), 200
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 bf932cf..16690ae 100644
--- a/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py
+++ b/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py
@@ -77,12 +77,10 @@ class ResourceOwnerPasswordCredentialsGrant(GrantTypeBase):
"""
self.request_validator = request_validator or RequestValidator()
self.refresh_token = refresh_token
- # 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.
@@ -117,11 +115,11 @@ class ResourceOwnerPasswordCredentialsGrant(GrantTypeBase):
return headers, e.json, e.status_code
token = token_handler.create_token(request, self.refresh_token)
- # 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 %r to client id %r (%r) and username %s.',
token, request.client_id, request.client, request.username)
return headers, json.dumps(token), 200