summaryrefslogtreecommitdiff
path: root/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
diff options
context:
space:
mode:
authorJoel Stevenson <jstevenson@bepress.com>2016-04-19 14:59:31 -0700
committerJoel Stevenson <jstevenson@bepress.com>2016-04-19 14:59:31 -0700
commitfde41caa25203f456a4650ae1e5501725622cbb7 (patch)
treef27b6bb28cac9bb603dffbf34cb98c83f1759ccc /oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
parent4c160d739a322964b873ca60f90df5384e337c44 (diff)
downloadoauthlib-fde41caa25203f456a4650ae1e5501725622cbb7.tar.gz
More wiring to get OpenID Connect code fully integrated.
Diffstat (limited to 'oauthlib/oauth2/rfc6749/grant_types/authorization_code.py')
-rw-r--r--oauthlib/oauth2/rfc6749/grant_types/authorization_code.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py b/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
index 1cecd37..c1826d0 100644
--- a/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
+++ b/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
@@ -267,11 +267,9 @@ class AuthorizationCodeGrant(GrantTypeBase):
return headers, e.json, e.status_code
token = token_handler.create_token(request, refresh_token=self.refresh_token)
- # NEW-FOR-OPENID
for modifier in self._token_modifiers:
token = modifier(token, token_handler, request)
- self.request_validator.save_token(token)
- # END-NEW-FOR-OPENID
+ self.request_validator.save_token(token, request)
self.request_validator.invalidate_authorization_code(
request.client_id, request.code, request)
return headers, json.dumps(token), 200
@@ -375,7 +373,6 @@ class AuthorizationCodeGrant(GrantTypeBase):
'request': request,
}
- # NEW-FOR-OPENID
for validator in self._authorization_validators:
request_info.update(validator(request))
@@ -383,7 +380,7 @@ class AuthorizationCodeGrant(GrantTypeBase):
def validate_token_request(self, request):
# REQUIRED. Value MUST be set to "authorization_code".
- if request.grant_type != 'authorization_code':
+ if request.grant_type not in ['authorization_code', 'openid']:
raise errors.UnsupportedGrantTypeError(request=request)
if request.code is None: