summaryrefslogtreecommitdiff
path: root/oauthlib/oauth2/rfc6749/endpoints/pre_configured.py
diff options
context:
space:
mode:
authorJoel Stevenson <joelstevenson@mac.com>2016-04-25 16:49:25 -0700
committerJoel Stevenson <joelstevenson@mac.com>2016-04-25 16:49:25 -0700
commit21f39752241c56ca4538d09e225f4653b9446d9e (patch)
tree6140b34572df732cc553ce7ac28158efc50ea0d6 /oauthlib/oauth2/rfc6749/endpoints/pre_configured.py
parentbd3dcb88fb957bfa3e43409af8b59245e88d2163 (diff)
downloadoauthlib-21f39752241c56ca4538d09e225f4653b9446d9e.tar.gz
Handle multi-valued response_types as specified in http://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#Combinations
Handle new 'none' response_type Implicit flow won't generate a token unless it is asked for (skipped for "id_token" response_type
Diffstat (limited to 'oauthlib/oauth2/rfc6749/endpoints/pre_configured.py')
-rw-r--r--oauthlib/oauth2/rfc6749/endpoints/pre_configured.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/oauthlib/oauth2/rfc6749/endpoints/pre_configured.py b/oauthlib/oauth2/rfc6749/endpoints/pre_configured.py
index 0914eb5..6ad5f5e 100644
--- a/oauthlib/oauth2/rfc6749/endpoints/pre_configured.py
+++ b/oauthlib/oauth2/rfc6749/endpoints/pre_configured.py
@@ -15,6 +15,7 @@ from ..grant_types import ImplicitGrant
from ..grant_types import ResourceOwnerPasswordCredentialsGrant
from ..grant_types import ClientCredentialsGrant
from ..grant_types import RefreshTokenGrant
+from ..grant_types import OpenIDConnectImplicit
from .authorization import AuthorizationEndpoint
from .token import TokenEndpoint
@@ -50,12 +51,23 @@ class Server(AuthorizationEndpoint, TokenEndpoint, ResourceEndpoint,
credentials_grant = ClientCredentialsGrant(request_validator)
refresh_grant = RefreshTokenGrant(request_validator)
openid_connect_auth = OpenIDConnectAuthCode(request_validator)
+ openid_connect_implicit = OpenIDConnectImplicit(request_validator)
+
bearer = BearerToken(request_validator, token_generator,
token_expires_in, refresh_token_generator)
+
+ # See http://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#Combinations for valid combinations
+ # internally our AuthorizationEndpoint will ensure they can appear in any order for any valid combination
AuthorizationEndpoint.__init__(self, default_response_type='code',
response_types={
'code': auth_grant,
'token': implicit_grant,
+ 'id_token': openid_connect_implicit,
+ 'id_token token': openid_connect_implicit,
+ 'code token': openid_connect_auth,
+ 'code id_token': openid_connect_auth,
+ 'code token id_token': openid_connect_auth,
+ 'none': auth_grant
},
default_token_type=bearer)
TokenEndpoint.__init__(self, default_grant_type='authorization_code',