I develop a back-end application in Java. This application must be connected to Azure AD.
The application receives the id token and the access token by another front-end application. In the back-end configuration, I try to get the public keys to verify the tokens accessing the OpenID Connect Metadata at this url : https://login.microsoftonline.com/[TENANT-ID]/v2.0/.well-known/openid-configuration
To access to this url, I need to put the microsoft certificate in the Java truststore.
I retrieve the certificate from my browser and import it to the truststore.
At the starting of the application, the certificates are listed and the new one is present.
But I always have this error : sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I think that I import the wrong certificate in the truststore but I don't see how to resolve this.
Thank you for your help.