Hi,
I'm trying to delegate auth to Azure AD in CAS 6.6.13.
It seems to delegate the auth to azure, the login is done but afterwards it fails when trying to decode the returned JWT
here's the error:
: [DelegatedClientAuthenticationHandler]: [org.pac4j.core.exception.TechnicalException: com.nimbusds.jose.proc.BadJOSEException: Signed JWT rejected: Another algorithm expected, or no matching key(s) found / com.nimbusds.jose.proc.BadJOSEException: Signed JWT rejected: Another algorithm expected, or no matching key(s) found]
and this happens because the sign keys are not matching, so in azure there are some commons keys and there seems to be some client specific keys.
In the case of client specific sign keys, the discovery url should look like this:
I tried to add the discovery-url obviously from cas.properties, but from what have debugged the value is hardcoded in:
org.pac4j.oidc.config.AzureAdOidcConfiguration
code snippet below:
I also checked the altest pac4j sources, and the code is similar
here the cas properties that I added in order to enable this delegation
So is this a limitation in pac4j? is there any easy way on how to override that discovery URL? I was thinking to try something with byte buddy
Any suggestions appreciated
thanks