@@ -63,6 +63,18 @@ fn add_authenticator_config(
6363 "druid.auth.pac4j.oidc.scope" . to_string ( ) ,
6464 Some ( scopes. join ( " " ) ) ,
6565 ) ;
66+
67+ // Serialize the enum to get the snake_case string representation
68+ let method_string =
69+ serde_json:: to_value ( oidc. client_authentication_method ) . expect ( "serializing ClientAuthenticationMethod to string" ) ;
70+ let method_string = method_string
71+ . as_str ( )
72+ . expect ( "ClientAuthenticationMethod should serialize to a string" ) ;
73+ config. insert (
74+ "druid.auth.pac4j.oidc.clientAuthenticationMethod" . to_string ( ) ,
75+ Some ( method_string. to_string ( ) ) ,
76+ ) ;
77+
6678 config. insert (
6779 "druid.auth.authenticatorChain" . to_string ( ) ,
6880 Some ( r#"["DruidSystemAuthenticator", "Oidc"]"# . to_string ( ) ) ,
@@ -184,11 +196,12 @@ mod tests {
184196 } ,
185197 "preferred_username" . to_owned ( ) ,
186198 vec ! [ "openid" . to_owned( ) ] ,
187- None ,
199+ Some ( oidc :: v1alpha1 :: IdentityProviderHint :: Keycloak ) ,
188200 ) ;
189201 let oidc = oidc:: v1alpha1:: ClientAuthenticationOptions {
190202 client_credentials_secret_ref : "nifi-keycloak-client" . to_owned ( ) ,
191203 extra_scopes : vec ! [ ] ,
204+ client_authentication_method : oidc:: v1alpha1:: ClientAuthenticationMethod :: ClientSecretPost ,
192205 product_specific_fields : ( ) ,
193206 } ;
194207
@@ -223,6 +236,10 @@ mod tests {
223236 ) )
224237 ) ;
225238
239+ assert_eq ! (
240+ properties. get( "druid.auth.pac4j.oidc.clientAuthenticationMethod" ) ,
241+ Some ( & Some ( "client_secret_post" . to_owned( ) ) )
242+ ) ;
226243 assert ! ( properties. contains_key( "druid.auth.pac4j.oidc.clientID" ) ) ;
227244 assert ! ( properties. contains_key( "druid.auth.pac4j.oidc.clientSecret" ) ) ;
228245 assert ! ( properties. contains_key( "druid.auth.pac4j.cookiePassphrase" ) ) ;
0 commit comments