Skip to content

Commit

Permalink
Allow to pass a nonce through the client
Browse files Browse the repository at this point in the history
  • Loading branch information
timhallmann committed Sep 30, 2024
1 parent fa23352 commit da89506
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def start_authentication(
client_id: str,
redirect_uri: str,
state: Optional[str] = None,
nonce: Optional[str] = None,
prompt: Optional[Union[list[str], str]] = None,
code_challenge: Optional[str] = None,
code_challenge_method: Optional[str] = None,
Expand All @@ -41,6 +42,7 @@ def start_authentication(
returning a which the end user now needs to visit.
:param state: The state intended to prevent Cross-Site Request Forgery.
:param nonce: String value used to associate a Client session with an ID Token, and to mitigate replay attacks.
:param prompt: Specifies whether the Authorization Server prompts the End-User for reauthentication and consent.
The defined values are: "none", "login", "consent" and "select_account", multiple may be given as a list.
Expand All @@ -52,6 +54,7 @@ def start_authentication(
redirect_uri=redirect_uri,
response_type="code",
state=state,
nonce=nonce,
prompt=prompt.split(" ") if isinstance(prompt, str) else prompt,
code_challenge=code_challenge,
code_challenge_method=code_challenge_method,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __init__(self, base_client: "OpenidClient"):
def start_authentication(
self,
state: Optional[str] = None,
nonce: Optional[str] = None,
prompt: Optional[Union[list[str], str]] = None,
code_challenge: Optional[str] = None,
code_challenge_method: Optional[str] = None,
Expand All @@ -39,6 +40,7 @@ def start_authentication(
returning a which the end user now needs to visit.
:param state: The state intended to prevent Cross-Site Request Forgery.
:param nonce: String value used to associate a Client session with an ID Token, and to mitigate replay attacks.
:param prompt: Specifies whether the Authorization Server prompts the End-User for reauthentication and consent.
The defined values are: "none", "login", "consent" and "select_account", multiple may be given as a list.
:param code_challenge: The code challenge intended for use with Proof Key for Code Exchange (PKCE) [RFC7636].
Expand All @@ -61,6 +63,7 @@ def start_authentication(
self._base_client.client_auth.client_id,
redirect_uri.tostr(),
state=state,
nonce=nonce,
prompt=prompt,
code_challenge=code_challenge,
code_challenge_method=code_challenge_method,
Expand Down

0 comments on commit da89506

Please sign in to comment.