Hi,
It doesn't work when set with a fake secret either.
I set the following in a TestConfigFactory class build() method (maven set to use jee-pac4j v5.0.0 and pac4j v4.5.0 libraries):
oidcConfiguration.setClientId("the client ID>");
oidcConfiguration.setSecret("fakevalue"); // set to a fake value, not the real one
oidcConfiguration.setDiscoveryURI("<an Okta developer account URI>");
oidcConfiguration.setScope("openid email profile");
oidcConfiguration.setPkceMethod(CodeChallengeMethod.S256);
oidcConfiguration.setWithState(true);
oidcConfiguration.setPreferredJwsAlgorithm(JWSAlgorithm.RS256);
oidcConfiguration.setUseNonce(true);
final OidcClient<OidcConfiguration> oidcClient = new OidcClient<>(oidcConfiguration);
final Clients clients = new Clients("<the callback URL>", oidcClient);
clients.init();
final Config config = new Config(clients);
config.addAuthorizer("admin", new RequireAnyRoleAuthorizer<>("ROLE_ADMIN"));
return config;
The method executeTokenRequest() in OidcAuthenticator.java throws a TechnicalException: "Bad token response, error=invalid_client"
The error object has: {"error":"invalid_client","error_description":"The client secret supplied for a confidential client is invalid."}
When I comment out
oidcConfiguration.setPkceMethod(CodeChallengeMethod.S256); line and provide the actual secret value it works correctly. However, the app needs to be configured with PKCE.
Thanks,
LV