You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/simple_openid_connect/data.py
+15
Original file line number
Diff line number
Diff line change
@@ -440,6 +440,12 @@ class AuthenticationRequest(OpenidBaseModel):
440
440
acr_values: Optional[List[str]] =None
441
441
"OPTIONAL. Requested Authentication Context Class Reference values Space-separated string that specifies the acr values that the Authorization Server is being requested to use for processing this Authentication Request, with the values appearing in order of preference The Authentication Context Class satisfied by the authentication performed is returned as the acr Claim Value, as specified in Section 2 The acr Claim is requested as a Voluntary Claim by this parameter."
442
442
443
+
code_challenge: Optional[str] =None
444
+
"OPTIONAL. Code Challenge. This parameter is intended for use with Proof Key for Code Exchange (PKCE) [RFC7636], to be used with code_challenge_method."
445
+
446
+
code_challenge_method: Optional[str] =None
447
+
"OPTIONAL. Code Challenge Method. This parameter is intended for use with Proof Key for Code Exchange (PKCE) [RFC7636], to be used with code_challenge."
@@ -575,6 +581,15 @@ class TokenRequest(OpenidBaseModel):
575
581
scope: Optional[str] =None
576
582
"REQUIRED, if grant type is 'password'. The scope requested by the application"
577
583
584
+
code_verifier: Optional[str] =None
585
+
"OPTIONAL. Code Verifier. This parameter is intended for use with Proof Key for Code Exchange (PKCE) [RFC7636], to be used with code_challenge and code_challenge_method."
586
+
587
+
code_challenge: Optional[str] =None
588
+
"OPTIONAL. Code Challenge. This parameter is intended for use with Proof Key for Code Exchange (PKCE) [RFC7636], to be used with code_verifier, code_challenge_method."
589
+
590
+
code_challenge_method: Optional[str] =None
591
+
"OPTIONAL. Code Challenge Method. This parameter is intended for use with Proof Key for Code Exchange (PKCE) [RFC7636], to be used with code_verifier, code_challenge."
Handle an authentication result that is communicated to the RP in form of the user agents current url after having started an authentication process via :func:`start_authentication`.
Copy file name to clipboardExpand all lines: src/simple_openid_connect/flows/authorization_code_flow/client.py
+19-1
Original file line number
Diff line number
Diff line change
@@ -27,11 +27,18 @@ class AuthorizationCodeFlowClient:
27
27
def__init__(self, base_client: "OpenidClient"):
28
28
self._base_client=base_client
29
29
30
-
defstart_authentication(self) ->str:
30
+
defstart_authentication(
31
+
self,
32
+
code_challenge: Optional[str] =None,
33
+
code_challenge_method: Optional[str] =None,
34
+
) ->str:
31
35
"""
32
36
Start the authentication process by constructing an appropriate :class:`AuthenticationRequest`, serializing it and
33
37
returning a which the end user now needs to visit.
34
38
39
+
:param code_challenge: The code challenge intended for use with Proof Key for Code Exchange (PKCE) [RFC7636].
40
+
:param code_challenge_method: The code challenge method intended for use with Proof Key for Code Exchange (PKCE) [RFC7636], typically "S256" or "plain".
41
+
35
42
:raises ImpossibleOperationError: If the client has no redirect_uri configured and therefore cannot perform this operation.
36
43
37
44
:returns: A URL to which the user agent should be redirected
Handle an authentication result that is communicated to the RP in form of the user agents current url after having started an authentication process via :func:`start_authentication`.
The authentication result should be encoded into this url by the authorization server.
63
75
:param additional_redirect_args: Additional URL parameters that were added to the redirect uri.
64
76
They are probably still present in `current_url` but since they could be of any shape, no attempt is made here to automatically reconstruct them.
77
+
:param code_verifier: The code verifier intended for use with Proof Key for Code Exchange (PKCE) [RFC7636].
78
+
:param code_challenge: The code challenge intended for use with Proof Key for Code Exchange (PKCE) [RFC7636].
79
+
:param code_challenge_method: The code challenge method intended for use with Proof Key for Code Exchange (PKCE) [RFC7636], typically "S256" or "plain".
65
80
66
81
:raises AuthenticationFailedError: If the current url indicates an authentication failure that prevents an access token from being retrieved.
67
82
:raises UnsupportedByProviderError: If the provider only supports implicit flow and has no token endpoint.
0 commit comments