@@ -83,6 +83,19 @@ def _nonce_hash(nonce):
83
83
return hashlib .sha256 (nonce .encode ("ascii" )).hexdigest ()
84
84
85
85
86
+ class Prompt (object ):
87
+ """This class defines the constant strings for prompt parameter.
88
+
89
+ The values are based on
90
+ https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
91
+ """
92
+ NONE = "none"
93
+ LOGIN = "login"
94
+ CONSENT = "consent"
95
+ SELECT_ACCOUNT = "select_account"
96
+ CREATE = "create" # Defined in https://openid.net/specs/openid-connect-prompt-create-1_0.html#PromptParameter
97
+
98
+
86
99
class Client (oauth2 .Client ):
87
100
"""OpenID Connect is a layer on top of the OAuth2.
88
101
@@ -217,6 +230,8 @@ def obtain_token_by_browser(
217
230
`OIDC <https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest>`_.
218
231
:param string prompt: Defined in
219
232
`OIDC <https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest>`_.
233
+ You can find the valid string values defined in :class:`oidc.Prompt`.
234
+
220
235
:param int max_age: Defined in
221
236
`OIDC <https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest>`_.
222
237
:param string ui_locales: Defined in
@@ -232,7 +247,7 @@ def obtain_token_by_browser(
232
247
for descriptions on other parameters and return value.
233
248
"""
234
249
filtered_params = {k :v for k , v in dict (
235
- prompt = prompt ,
250
+ prompt = " " . join ( prompt ) if isinstance ( prompt , ( list , tuple )) else prompt ,
236
251
display = display ,
237
252
max_age = max_age ,
238
253
ui_locales = ui_locales ,
0 commit comments