Closed banterCZ closed 2 months ago
The authentication of token request is invalid, see:
https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.3.1.3.1
The mentioned example is non-normative, but still a perfect catch. We have to support more authentication methods as described at https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication
We should also consider whether it would be beneficial to use existing libraries for fetching and validating tokens, see e.g.: https://github.com/spring-projects/spring-security/blob/main/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/oidc/authentication/OidcIdTokenDecoderFactory.java https://github.com/spring-projects/spring-security/blob/main/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/oidc/authentication/OidcIdTokenValidator.java
If it's not possible to reuse existing libraries, let's at least review that all validations done by existing libraries are present.