Skip to content

Commit f8c66a2

Browse files
Add prompt option to creating authorization urls
1 parent f05a0ec commit f8c66a2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

workos/user_management.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ def get_authorization_url(
325325
connection_id: Optional[str] = None,
326326
organization_id: Optional[str] = None,
327327
code_challenge: Optional[str] = None,
328+
prompt: Optiona[str] = None,
328329
) -> str:
329330
"""Generate an OAuth 2.0 authorization URL.
330331
@@ -349,6 +350,7 @@ def get_authorization_url(
349350
state (str): An encoded string passed to WorkOS that'd be preserved through the authentication workflow, passed
350351
back as a query parameter. (Optional)
351352
code_challenge (str): Code challenge is derived from the code verifier used for the PKCE flow. (Optional)
353+
prompt (str): The prompt parameter can be used to specify whether the user should be prompted for credentials or not.
352354
353355
Returns:
354356
str: URL to redirect a User to to begin the OAuth workflow with WorkOS
@@ -379,6 +381,8 @@ def get_authorization_url(
379381
if code_challenge:
380382
params["code_challenge"] = code_challenge
381383
params["code_challenge_method"] = "S256"
384+
if prompt is not None:
385+
params["prompt"] = prompt
382386

383387
return RequestHelper.build_url_with_query_params(
384388
base_url=self._client_configuration.base_url,

0 commit comments

Comments
 (0)