Azure证书放入信任存储库

huangapple 未分类评论45阅读模式
英文:

Azure Certificate to put into truststore

问题

我在Java中开发一个后端应用程序。此应用程序必须连接到Azure AD。

该应用程序通过另一个前端应用程序接收id令牌和访问令牌。
在后端配置中,我尝试获取用于验证令牌的公钥,通过访问此URL上的OpenID Connect元数据:https://login.microsoftonline.com/[TENANT-ID]/v2.0/.well-known/openid-configuration

为了访问这个URL,我需要将Microsoft证书放入Java信任存储库中。
我从浏览器中检索证书并将其导入到信任存储库中。
在应用程序启动时,列出了证书并且新证书也存在。
但我始终遇到此错误:sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

我认为我将错误的证书导入到了信任存储库中,但我不知道如何解决这个问题。

感谢您的帮助。

英文:

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.

huangapple
  • 本文由 发表于 2020年7月25日 02:21:33
  • 转载请务必保留本文链接:https://java.coder-hub.com/63079386.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定