@@ -282,7 +282,7 @@ defmodule Assent.Strategy.OIDC do
282282 @ spec callback ( Keyword . t ( ) , map ( ) , atom ( ) ) :: on_callback ( )
283283 def callback ( config , params , strategy \\ __MODULE__ ) do
284284 with { :ok , openid_config } <- fetch_openid_configuration ( config ) ,
285- { :ok , method } <- fetch_client_authentication_method ( openid_config , config ) ,
285+ { :ok , method } <- fetch_client_authentication_method ( config ) ,
286286 { :ok , token_url } <- fetch_from_openid_config ( openid_config , "token_endpoint" ) do
287287 config
288288 |> Keyword . put ( :openid_configuration , openid_config )
@@ -292,15 +292,10 @@ defmodule Assent.Strategy.OIDC do
292292 end
293293 end
294294
295- defp fetch_client_authentication_method ( openid_config , config ) do
296- method = Keyword . get ( config , :client_authentication_method , "client_secret_basic" )
297- methods = Map . get ( openid_config , "token_endpoint_auth_methods_supported" )
298- supported_method? = ( is_nil ( methods ) && true ) || method in methods
299-
300- case supported_method? do
301- true -> parse_client_auth_method ( method )
302- false -> { :error , "Unsupported client authentication method: #{ method } " }
303- end
295+ defp fetch_client_authentication_method ( config ) do
296+ config
297+ |> Keyword . get ( :client_authentication_method , "client_secret_basic" )
298+ |> parse_client_auth_method ( )
304299 end
305300
306301 defp parse_client_auth_method ( "none" ) , do: { :ok , nil }
0 commit comments