Hi,
In pac4j 5.7.7 (and looking at the code 6.x also), when validating an OIDC token pac4j swallows all but one of the exceptions from all of the registered token validators.
as you can have many token validators configured and some may not have the required information, the code itterates through them all to find one validator that matches and returns OK.
However in the case that none of them can validate, an exception from the first validator only is thrown, and if this is missing information as it is not the validor for this token then you are presented with a very generic exception. The interesting exception (which is likely a signature mismatch or expiry etc) is just swallowed.
e.g.
com.nimbusds.jose.proc.BadJOSEException: Signed JWT rejected: Another algorithm expected, or no matching key(s) found
at PluginClassLoader for oic-auth//com.nimbusds.jwt.proc.DefaultJWTProcessor.process(DefaultJWTProcessor.java:357)
at PluginClassLoader for oic-auth//com.nimbusds.openid.connect.sdk.validators.IDTokenValidator.validate(IDTokenValidator.java:321)
at PluginClassLoader for oic-auth//com.nimbusds.openid.connect.sdk.validators.IDTokenValidator.validate(IDTokenValidator.java:254)
at PluginClassLoader for oic-auth//org.pac4j.oidc.profile.creator.TokenValidator.validate(TokenValidator.java:108)
at PluginClassLoader for oic-auth//org.pac4j.oidc.profile.creator.OidcProfileCreator.create(OidcProfileCreator.java:108)
Caused: org.pac4j.core.exception.TechnicalException
at PluginClassLoader for oic-auth//org.pac4j.oidc.profile.creator.OidcProfileCreator.create(OidcProfileCreator.java:152)
at PluginClassLoader for oic-auth//org.jenkinsci.plugins.oic.OicSecurityRealm.doFinishLogin(OicSecurityRealm.java:1279)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:416)
at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:429)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:211)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:138)
at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:644)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:61)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:827)