Questions tagged [google-oauth-java-client]

For questions about the use of the Google OAuth Client Library for Java.

The Google OAuth Client Library for Java provides Java classes and methods for both OAuth 1.0a and OAuth 2.0.

This library allows a Java application to gain permission from a user to access the personal data they store with an OAuth provider such as Twitter, Facebook, Instagram, and many others. The user is directed by the OAuth library to the provider site and must confirm to the provider that they are happy for the requested information to be shared. If permission is granted then an access token is made available to the OAuth library and requests for the granted information can be made successfully.

See for more information about the OAuth standards.

This tag should be used for questions about writing Java software which uses the Google OAuth Client Library for Java, for either OAuth 1.0a or OAuth 2.0.

143 questions
4
votes
2 answers

Java Jar -java.lang.NoClassDefFoundError: com.google.api.client.http.HttpTransport from

i am using webmaster tool Java api V3 to query data , my code work fine in eclipse but when i export it to a Jar i get the error below Exception in thread "main" java.lang.NoClassDefFoundError: com.google.api.client.http.HttpTransport at…
4
votes
1 answer

Redirect_uri when trying to exchange an authcode from backend server when the authcode was received in an ios app

I have an ios app and a web app that gets authorization from users and generates an authcode and sends it to the backend java servlet which tries to exchange the authcode for access & refresh tokens. Exchanging the authcode from the web app is…
4
votes
1 answer

Google Analytics : Get access token from refresh token

I am working with google analytics api in Java. I have a code which fetches access token from refresh token. We store the refresh token in the database and while requesting, retrieve access token. After password change, our request token became…
4
votes
0 answers

Google OAuth2 Migration and App Engine UserService

Context I'm in the process of migrating a Google App Engine app written in Java over from using OpenId/OAuth1 to OAuth2. I've got the OAuth2 flow working and am able to correctly retrieve/store the tokens for the user. Issue The existing…
3
votes
0 answers

How to implement a custom DataStoreFactory for use with Google APIs using OAuth2?

I'm trying to implement a custom DataStoreFactory as mentioned in the docs here so that I can authenticate with Google APIs and store my access/refresh tokens in my database, but I can't find any documentation or examples of a custom implementation…
RTF
  • 6,214
  • 12
  • 64
  • 132
3
votes
0 answers

Google OAuth2 asking for account details twice

I am working on javascript to authenticate the user through google using OAuth. I am getting the user to sign in but the account chooser is opened twice, it selects the account once and again asks for the account then asks for offline access…
SJMan
  • 1,547
  • 2
  • 14
  • 37
3
votes
1 answer

Check for new emails from Gmail with Gmail API and OAuth2 in Android

I'm really at a dead end. I've been trying to figure out how to reach my Gmail-inbox from an Android-app with an existing OAuth2-token that I have received from Google moments before. I can auth myself with a token with this: URL url = new…
3
votes
1 answer

How do I change a user's password using Google's Directory API using Java?

I'm going to apologize in advance that I'm likely missing a few pieces of information to let anyone know that my settings are correct. Please let me know what else I need to specify. I work at a university where we host student email accounts…
3
votes
1 answer

Googles AuthorizationCodeInstalledApp.authorize() method freezing on canceled auth

I have a Java application that needs to get users to authorize my application's access to Google services. I have the following bit of code in place to show and obtain the authorization I need: GoogleAuthorizationCodeFlow flow = new…
ChargerIIC
  • 1,620
  • 1
  • 33
  • 47
3
votes
1 answer

User Registration & Login | SSO using Spring Security OAuth 2.0

I am trying to implement user registration and log in flow | SSO using Spring Security Oauth 2.0 and Google as the authentication provider. How should I initiate registration and login flow? What filter needs to be applied? In registration flow, I…
3
votes
1 answer

Coldfusion not loading nested class of jar file

I am loading Google's java client for service account authorization by putting the .jar files in the WEB-INF/lib folder of the Coldfusion server. The java objects can be created by like this:
jk.
  • 14,365
  • 4
  • 43
  • 58
3
votes
3 answers

Getting a 403 - Forbidden for Google Service Account

I am trying to get an access token for Google Service Account. Following is my code - String SERVICE_ACCOUNT_EMAIL = "edited@developer.gserviceaccount.com"; List scope = new…
2
votes
0 answers

GoogleIdTokenVerifier.verify always returns null

I am trying to validate a JWT Token sent by Google to my application . I am using the below code to validate the JWT token but verifier.verify(token) always returns null even if the token is valid. I have tested the token in another NodeJS code i…
2
votes
1 answer

What is the relationship between AbstractAuthorizationCodeServlet and AbstractAuthorizationCodeCallbackServlet?

I'm trying to understand this example project which uses Google's OAuth library to let users login with their Google account. Specifically, I'm trying to understand the relationship between Oauth2AuthorizationCodeServlet.java and…
2
votes
2 answers

Cannot get access to Google Calendar API via Service Account

I'm trying to retrieve my own free/busy calendar via a simple POST call in Java, and I'm running into access errors. Basically I'm getting a 404, notFound error like so: { "kind": "calendar#freeBusy", "timeMin": "2019-05-28T13:00:00.000Z", …
1
2
3
9 10