OpenID:发现异常:org.openid4java.discovery.yadis.YadisException:0x706:GET 失败 503:HTTP/1.0 503 服务不可用
我基于 Google OpenID OpenID4Java
构建了供内部使用的 OpenID
服务器。
我将其部署在 Apache-Tomcat 6.0 上。
当消费者试图发现时,
org.openid4java.discovery.yadis.YadisException: 0x706: GET failed on http://localhost:9090/idp4java/idp : 503:HTTP/1.0 503 Service Unavailable
at org.openid4java.discovery.yadis.YadisResolver.retrieveXrdsLocation(YadisResolver.java:371)
at org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:233)
at org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:221)
当我通过 url http 访问 XRDS
时, 它会抛出以下错误://localhost:9090/idp4java/idp 我正在获取它,但是当我的消费者代码尝试获取它时,就会出现上述错误。
我们需要在 Tomcat
上进行任何设置才能启用 Yadis
吗?
任何想法为什么会发生这种情况。我的代码在 Google IDP
上运行良好。
提前致谢。 杰哈
I build the OpenID
server for Internal use based on Google OpenID OpenID4Java
.
I deployed it on Apache-Tomcat 6.0
.
When consumer is trying to discover, It's throwing follwoing error
org.openid4java.discovery.yadis.YadisException: 0x706: GET failed on http://localhost:9090/idp4java/idp : 503:HTTP/1.0 503 Service Unavailable
at org.openid4java.discovery.yadis.YadisResolver.retrieveXrdsLocation(YadisResolver.java:371)
at org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:233)
at org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:221)
When I am accessing the XRDS
by url http://localhost:9090/idp4java/idp I am getting it but when my consumer code trying to get it then above error is coming.
Do we need to do any setting on Tomcat
to enable Yadis
?
Any Idea why this might be happening. My code is working fine with Google IDP
.
Thanks in Advance.
Jha
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
上周五对此进行了一些研究并可以解决它。
今天早上把logger级别调试了一下,发现是由于代码中的Proxy设置而出现了HTTP Error 503。
在生产场景中,您将需要代理设置,以便可以连接 OpenID。您的应用程序服务器/网络服务器需要直接连接到 OpenID 以进行发现和关联过程。
HttpClientFactory.setProxyProperties(proxySettings);
HttpClientFactory 类来自 OpenID4Java。
注释完上面的行后,我开始收到 404 错误。
原因是 OpenIDURL 末尾有“/”,即 http://myopenid.net/idp/。当我删除这个“/”时,它开始工作。
谢谢
杰哈
Last Friday did some reserach on this and could resolved it.
Today morning put the logger level to debug to see what's going on and found that the HTTP Error 503 was coming due to Proxy setting in the code.
In the Production scnenario you will need the Proxy setting so that OpenID can be connected.You appserver/webserver need to connect directly to OpenID for Discovery and Association process.
HttpClientFactory.setProxyProperties(proxySettings);
HttpClientFactory class is from OpenID4Java.
After commenting the above line I start getting the 404 Error.
Reason for that was "/" at the End of OpenIDURL i.e. http://myopenid.net/idp/. When I removed this "/" it start working.
Thanks
Jha