@@ -257,7 +257,7 @@ def well_known(self):
257
257
data_raw = self .connection .raw_get (URL_WELL_KNOWN .format (** params_path ))
258
258
return raise_error_from_response (data_raw , KeycloakGetError )
259
259
260
- def auth_url (self , redirect_uri , scope = "email" , state = "" ):
260
+ def auth_url (self , redirect_uri , scope = "email" , state = "" , nonce = "" ):
261
261
"""Get authorization URL endpoint.
262
262
263
263
:param redirect_uri: Redirect url to receive oauth code
@@ -266,6 +266,8 @@ def auth_url(self, redirect_uri, scope="email", state=""):
266
266
:type scope: str
267
267
:param state: State will be returned to the redirect_uri
268
268
:type state: str
269
+ :param nonce: Associates a Client session with an ID Token to mitigate replay attacks
270
+ :type nonce: str
269
271
:returns: Authorization URL Full Build
270
272
:rtype: str
271
273
"""
@@ -275,6 +277,7 @@ def auth_url(self, redirect_uri, scope="email", state=""):
275
277
"redirect-uri" : redirect_uri ,
276
278
"scope" : scope ,
277
279
"state" : state ,
280
+ "nonce" : nonce ,
278
281
}
279
282
return URL_AUTH .format (** params_path )
280
283
@@ -903,7 +906,7 @@ async def a_well_known(self):
903
906
data_raw = await self .connection .a_raw_get (URL_WELL_KNOWN .format (** params_path ))
904
907
return raise_error_from_response (data_raw , KeycloakGetError )
905
908
906
- async def a_auth_url (self , redirect_uri , scope = "email" , state = "" ):
909
+ async def a_auth_url (self , redirect_uri , scope = "email" , state = "" , nonce = "" ):
907
910
"""Get authorization URL endpoint asynchronously.
908
911
909
912
:param redirect_uri: Redirect url to receive oauth code
@@ -912,6 +915,8 @@ async def a_auth_url(self, redirect_uri, scope="email", state=""):
912
915
:type scope: str
913
916
:param state: State will be returned to the redirect_uri
914
917
:type state: str
918
+ :param nonce: Associates a Client session with an ID Token to mitigate replay attacks
919
+ :type nonce: str
915
920
:returns: Authorization URL Full Build
916
921
:rtype: str
917
922
"""
@@ -921,6 +926,7 @@ async def a_auth_url(self, redirect_uri, scope="email", state=""):
921
926
"redirect-uri" : redirect_uri ,
922
927
"scope" : scope ,
923
928
"state" : state ,
929
+ "nonce" : nonce ,
924
930
}
925
931
return URL_AUTH .format (** params_path )
926
932
0 commit comments