无法找到请求目标的有效认证路径 (CaCerts)
温馨提示:
本文最后更新于 2024年04月12日,已超过 26 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我。
I'm having trouble integrating SSO ADFS with the Oauth2 security standard
Information about integration:
Github : https://github.com/millsofmn/oauth2-example
JDK: 8u391
Framework: Springboot
Content file application.yml
server:
contextPath: /oauth2-example
port: 8443
ssl:
key-store: C:\Users\Administrator\Desktop\oauth2-example-master\oauth2-example-master\src\main\resources\keystore
key-store-password: 123456a@
keyStoreType: JKS
keyAlias: server
security:
oauth2:
client:
clientId: 00f095e8-xxxxx-460c-9294-xxxxxxxx
userAuthorizationUri: https://adfs.teemb.com/adfs/oauth2/authorize?resource=https://localhost:8443/oauth2-example/
accessTokenUri: https://adfs.teemb.com/adfs/oauth2/token
clientAuthenticationScheme: form
authorizedGrantTypes: authorization_code
preEstablishedRedirectUri: https://localhost:8443/oauth2-example/login
useCurrentUri: false
tokenName: code
authenticationScheme: query
resource:
userInfoUri: https://adfs.teemb.com/adfs/oauth2/token/userinfo
logging:
level:
com.millsofmn.example: DEBUG
org.springframework.security: DEBUG
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} - %msg%n"
Config file Eclipse.Init im imported
-vmargs
-Djavax.net.ssl.trustStore="C:/Program Files/Java/jdk-1.8/jre/lib/security/cacerts"
-Djavax.net.ssl.trustStorePassword="changeit"
Error when run project :
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:148)
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:129)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434)
... 88 common frames omitted
2024-04-09 19:08:20 - Updated SecurityContextHolder to contain null Authentication
2024-04-09 19:08:20 - Delegating to authentication failure handler org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler@43e570df
2024-04-09 19:08:20 - No failure URL set, sending 401 Unauthorized error
2024-04-09 19:08:20 - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
2024-04-09 19:08:20 - SecurityContextHolder now cleared, as request processing completed
I have researched on the internet, in general this error is because Eclipse's JVM cannot find the path of Cacerts in the Java environment. I have configured according to the instructions in the Eclipse.Init file and restarted Eclipse, but I still get the problem. error unable to find valid certification path to requested target and no solution
Hope for your Support
正文到此结束
- 本文标签: 家庭宠物
- 本文链接: https://www.coder6.net/article/2397
- 版权声明: 本文由蚂蚁原创发布,转载请遵循《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权