Skip to content

Commit e5b698e

Browse files
committed
Add support to SOCIAL_AUTH_OIDC_PROMPT
Related to #1124
1 parent 7066da9 commit e5b698e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

social_core/backends/open_id_connect.py

+14
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class OpenIdConnectAuth(BaseOAuth2):
6464
USERINFO_URL = ""
6565
JWKS_URI = ""
6666
TOKEN_ENDPOINT_AUTH_METHOD = ""
67+
# Optional parameters for Authentication Request
68+
PROMPT = ""
6769

6870
def __init__(self, *args, **kwargs):
6971
self.id_token = None
@@ -131,6 +133,18 @@ def auth_params(self, state=None):
131133
"""Return extra arguments needed on auth process."""
132134
params = super().auth_params(state)
133135
params["nonce"] = self.get_and_store_nonce(self.authorization_url(), state)
136+
137+
prompt = self.setting(
138+
"PROMPT", default=self.PROMPT
139+
)
140+
is_prompt_valid = True
141+
for prompt_token in prompt.split():
142+
if prompt_token not in ("none", "login", "consent", "select_account"):
143+
is_prompt_valid = False
144+
break
145+
if is_prompt_valid:
146+
params["prompt"] = prompt
147+
134148
return params
135149

136150
def get_and_store_nonce(self, url, state):

0 commit comments

Comments
 (0)