@@ -68,14 +68,20 @@ async def authenticate_request(self, request: Request) -> OAuthClientInformation
6868 match client .token_endpoint_auth_method :
6969 case "client_secret_basic" :
7070 if client_credentials .auth_method != "client_secret_basic" :
71- raise AuthenticationError (f"Expected client_secret_basic authentication method, but got { client_credentials .auth_method } " )
71+ raise AuthenticationError (
72+ f"Expected client_secret_basic authentication method, but got { client_credentials .auth_method } "
73+ )
7274 case "client_secret_post" :
7375 if client_credentials .auth_method != "client_secret_post" :
74- raise AuthenticationError (f"Expected client_secret_post authentication method, but got { client_credentials .auth_method } " )
76+ raise AuthenticationError (
77+ f"Expected client_secret_post authentication method, but got { client_credentials .auth_method } "
78+ )
7579 case "none" :
7680 pass
7781 case _:
78- raise AuthenticationError (f"Unsupported auth method: { client .token_endpoint_auth_method } " ) # pragma: no cover
82+ raise AuthenticationError ( # pragma: no cover
83+ f"Unsupported auth method: { client .token_endpoint_auth_method } "
84+ )
7985
8086 # If client from the store expects a secret, validate that the request provides
8187 # that secret
@@ -97,9 +103,9 @@ async def authenticate_request(self, request: Request) -> OAuthClientInformation
97103 async def _get_credentials (self , request : Request ) -> ClientCredentials :
98104 """
99105 Extract client credentials from request, either from form data or Basic auth header.
100-
106+
101107 Basic auth header takes precedence over form data.
102-
108+
103109 Args:
104110 request: The HTTP request containing client credentials
105111 Returns:
@@ -131,7 +137,7 @@ async def _get_credentials(self, request: Request) -> ClientCredentials:
131137 client_id = form_data .get ("client_id" )
132138 if not client_id :
133139 raise AuthenticationError ("Missing client_id" )
134-
140+
135141 raw_client_secret = form_data .get ("client_secret" )
136142 client_secret = str (raw_client_secret ) if isinstance (raw_client_secret , str ) else None
137143 return ClientCredentials (
0 commit comments