jainshravan123 / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

404 Error while accessing https://www.googleapis.com/oauth2/v1/certs #913

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-api-java-client (e.g. 1.15.0-rc)?
1.17.0, 1.18.0, 1.19.0

Java environment (e.g. Java 6, Android 2.3, App Engine)?
any

Describe the problem.
http://stackoverflow.com/questions/26615522/404-error-while-accessing-https-www-
googleapis-com-oauth2-v1-certs

The https://www.googleapis.com/oauth2/v1/certs replies with 404.

Stack trace:
com.google.api.client.http.HttpResponseException: 404 Not Found
        at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1054) [google-http-client-1.18.0-rc.jar:1.18.0-rc]
        at com.google.api.client.googleapis.auth.oauth2.GooglePublicKeysManager.refresh(GooglePublicKeysManager.java:172) [google-api-client-1.18.0-rc.jar:1.18.0-rc]
        at com.google.api.client.googleapis.auth.oauth2.GooglePublicKeysManager.getPublicKeys(GooglePublicKeysManager.java:141) [google-api-client-1.18.0-rc.jar:1.18.0-rc]
        at com.google.api.client.googleapis.auth.oauth2.GoogleIdTokenVerifier.verify(GoogleIdTokenVerifier.java:173) [google-api-client-1.18.0-rc.jar:1.18.0-rc]
        at info.gacivs.backend.services.TokenValidatorService.validateGoogleToken(TokenValidatorService.java:124) [classes:]

How would you expect it to be fixed?
I don't know... I think the solution is on the Google side, but I can't reach 
them... :/

Original issue reported on code.google.com by auth.ga...@gmail.com on 29 Oct 2014 at 7:23

GoogleCodeExporter commented 9 years ago
The same issue persists with:

https://www.googleapis.com/oauth2/v2/certs

which makes logging in to our user system through a google account impossible 
at the current time.

Original comment by Ntimi.Sc...@gmail.com on 29 Oct 2014 at 4:39

GoogleCodeExporter commented 9 years ago
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);

Original comment by auth.ga...@gmail.com on 29 Oct 2014 at 6:36

GoogleCodeExporter commented 9 years ago
Services seems to be ok now

Original comment by corfire....@gmail.com on 29 Oct 2014 at 8:32

GoogleCodeExporter commented 9 years ago

Original comment by wonder...@google.com on 29 Dec 2014 at 4:58