@@ -256,6 +256,7 @@ def __init__(
256256 title : str = None ,
257257 default_clients : Union [List [dict ], None ] = None ,
258258 requests_session : Optional [requests .Session ] = None ,
259+ authorization_parameters : Optional [dict ] = None ,
259260 ):
260261 # TODO: id and title are required in the openEO API spec.
261262 self .id = provider_id
@@ -280,6 +281,7 @@ def __init__(
280281 self ._scopes = {"openid" }.union (scopes or []).intersection (self ._supported_scopes )
281282 log .debug (f"Scopes: provider supported { self ._supported_scopes } & backend desired { scopes } -> { self ._scopes } " )
282283 self .default_clients = default_clients
284+ self .authorization_parameters = authorization_parameters or {}
283285
284286 @classmethod
285287 def from_dict (cls , data : dict ) -> OidcProviderInfo :
@@ -289,6 +291,7 @@ def from_dict(cls, data: dict) -> OidcProviderInfo:
289291 issuer = data ["issuer" ],
290292 scopes = data .get ("scopes" ),
291293 default_clients = data .get ("default_clients" ),
294+ authorization_parameters = data .get ("authorization_parameters" ),
292295 )
293296
294297 def get_scopes_string (self , request_refresh_token : bool = False ) -> str :
@@ -563,6 +566,7 @@ def _get_auth_code(self, request_refresh_token: bool = False) -> AuthCodeResult:
563566 "nonce" : nonce ,
564567 "code_challenge" : pkce .code_challenge ,
565568 "code_challenge_method" : pkce .code_challenge_method ,
569+ ** self ._client_info .provider .authorization_parameters ,
566570 }
567571 ),
568572 )
@@ -855,6 +859,7 @@ def _get_verification_info(self, request_refresh_token: bool = False) -> Verific
855859 if self ._pkce :
856860 post_data ["code_challenge" ] = self ._pkce .code_challenge
857861 post_data ["code_challenge_method" ] = self ._pkce .code_challenge_method
862+ post_data .update (self ._client_info .provider .authorization_parameters )
858863 resp = self ._requests .post (url = self ._device_code_url , data = post_data )
859864 if resp .status_code != 200 :
860865 raise OidcException (
0 commit comments