Hi,
I am using pac4j-oidc 5.2.1 in my app and one customer uses a LemonLDAP OpenId connect Provider, see their doc at
https://www.lemonldap-ng.org/documentation/latest/idpopenidconnect.htmlAs you can see in their doc, the openid connect metadata contains the 'none' value for the key 'id_token_signing_alg_values_supported' but also other algorithms.
The lemonldap mailing list confirmed to that customer that the alg "none" is never used unless you explicitely configure it on a RP. So far, they respect the openid connect spec.
Given a default OidcClient with a default OidcConfiguration and such metadata, this provider fails to authenticate because when generating the TokenValidator, a TechnicalException is thrown at
https://github.com/pac4j/pac4j/blob/5.2.x/pac4j-oidc/src/main/java/org/pac4j/oidc/profile/creator/TokenValidator.java#L58 when parsing these metadata
Latest pac4j-oidc throws the same Exception because by default allowUnsignedIdToken is false (which is good) so the if condition around this exception evaluates to true.
Could pac4j-oidc throw this blocking configuration error only if 'none' is the only value in the metadata ?
And if there are other algorithms just don't add the 'none' algorithm to the idTokenValidators if it is not explicitely allowed by the OidcConfiguration ?
Given the default configuration, the token validation will throw a BadJOSEException or alike if a token is sent unsigned because no signed alg could validate it.
In a word, I suggest that pac4j-oidc refuses unsigned idtoken if not explicitely allowed in the client but accepts a provider supporting it but not using it.
I also take this time to say Thanks for the amazing work on pac4j, very clean code, documented and easy to use api ! And for the continued support !
Best regards,
Guillaume