访问https://www.googleapis.com/oauth2/v1/certs时出现404错误 [英] 404 Error while accessing https://www.googleapis.com/oauth2/v1/certs
问题描述
更新: 截至美东时间29.10.204 5:00,服务似乎运行正常
UPDATE : As of 29.10.204 5:00 PM EST the services seems to be working fine
我们正在尝试进行authToken身份验证,并且所有请求均失败,并显示404错误. 从今天早上(2014年10月28日)开始.
We are trying to do authToken authentication and all the request are failing with 404 error. This started happening since this morning (28-10-2014).
这是从欧洲(德国)发生的
This is happening from Europe (Germany)
修改
现在我也从美国看到相同的行为,但是失败率比德国低.
Now I am seeing the same behavior from USA as well but the failure rate is less as compared to Germany.
java.io.FileNotFoundException: https://www.googleapis.com/oauth2/v1/certs
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1514)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1508)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1162)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
推荐答案
我已经解决了!下载了证书,将其作为静态内容添加到我的应用程序中,并重写了公共证书的URL.这是代码段:
I've made a workaround! Downloaded the certs, added into my application as static content and rewrite the URL of the public certs. Here is the snippet:
final GoogleIdToken idToken = GoogleIdToken.parse(JSON_FACTORY, token);
final GooglePublicKeysManager manager = new GooglePublicKeysManager.Builder(HTTP_TRANSPORT, JSON_FACTORY)
.setPublicCertsEncodedUrl("http://localhost:8080/static/certs.json").build();
final GoogleIdTokenVerifier verifier = new GoogleIdTokenVerifier.Builder(manager)
.setAudience(Arrays.asList(CLIENT_ID)).build();
verifier.verify(idToken);
这是一种解决方法,希望Google能够解决此问题...:(
It's a workaround, I hope, the Google fix the issue... :(
这篇关于访问https://www.googleapis.com/oauth2/v1/certs时出现404错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!