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
77
votes
5 answers

Google OAUTH: The redirect URI in the request did not match a registered redirect URI

I am trying to make an upload to YouTube from my Java based web app, I spent a few days to understand what and where is the problem and I cannot get it, for now I am pulling my hair out off my head. I registered my web app in Google Console, so I…
18
votes
2 answers

Forcing a user to choose an account via Google OAuth2

I have the following workflow in my application: user logs into my custom app user clicks a button to link their YouTube account application makes a server side request using the code listing below user is redirected to the google auth url At this…
ThaDon
  • 7,826
  • 9
  • 52
  • 84
12
votes
7 answers

How to fix the "Malformed auth code" when trying to refreshToken on the second attempt?

I'm developping an Android App with Angular and Cordova plugins and I want to integrate it with Google Authentication. I have installed the cordova-plugin-googleplus and I have successfully integrated into the application. When the user logs in, I…
12
votes
4 answers

Gmail API access using Android

I am trying to access the Gmail API using an Android application. I have successfully requested and received an access token using all available scope combinations. But it seems that every time I actually try to use the Gmail API command I am…
10
votes
2 answers

Is "Authorized redirect URI" mandatory when setting up a new clientId under google developers console?

The authorized redirect URI is used by google to do a callback to pass the authorization token. It is also used for validation by google. So when receiving the actual oauth request, google checks to see if the callback url given in the request is…
Zenil
  • 1,491
  • 3
  • 12
  • 21
8
votes
2 answers

Server side authorization with Google Play Developer API?

Authorization is required to fetch information from the Google Play Developer API. I know how to do this with Postman, but implementing authorization is much more cumbersome (redirect url, handling redirects, and so on...) These would be the steps…
Bevor
  • 8,396
  • 15
  • 77
  • 141
8
votes
1 answer

Youtube Data API - How to avoid Google OAuth redirect URL authorization

Requirement: I am trying to upload videos to my Youtube channel through Youtube Data API for Java. The request is sent from a war file hosted on tomcat container.My application is not for external users and I only use it to upload my own generated…
7
votes
1 answer

Gmail atom feed with 2-legged OAuth receive 401 error

We are experiencing the issue of Gmail atom feed with 2-legged OAuth, an error message is "401 unauthorized". The error message is like below. Unauthorized
6
votes
1 answer

Google OAuth consent screen mentions data that my app did not request

My webapp uses "Sign In with Google for Web" (https://accounts.google.com/gsi/client script). For various reasons, I now want to get rid of the JS library and implement the required steps using only Google OAuth Client Library for Java, version…
6
votes
3 answers

Gmail (for business) API doesn't allow to send email from Alias?

I want to email my customers using different "roles" (e.g. info@ , customer-support@, tech-support@, no-reply@). I've tried 2 approaches: Multiple "users"/accounts in my Gmail for business application. Single gmail account with multiple…
Scott Mayers
  • 437
  • 6
  • 18
5
votes
0 answers

401 response when athenticating via Service Account and OAuth2 to GoogleDrive

I seem to have hit a wall trying to get a Java application to list of files stored in my GoogleDrive folder. The I have a project setup in the Developer Console. I have enabled for that project the Drive API I have create Auth credentials for a…
5
votes
1 answer

Authenticate as a service account from Android app for Google Cloud Storage

I have an Android app that will be eventually storing user-generated content in a Google Cloud Storage bucket. But I am unable to do so from my app code. The code looks like this: JsonFactory JSON_FACTORY =…
5
votes
1 answer

Google OAuth 2.0 incremental authorization not working

I have a server-side application that needs access to a combination of Google APIs, for some users of our app we only need access to one API/set of scopes (say Google Drive), for other users to another API/scope (say G+), and for some we need access…
David
  • 1,359
  • 1
  • 13
  • 20
5
votes
1 answer

Google OAuth Java client and Twitter API

I'm having issues invoking twitter REST API using Google OAuth Java Client. I'm able to do the first steps correctly: Set the authorization URL, Get the temporary token, Generate the final token. Then the OAuth Javadoc says: Use the stored…
out_sid3r
  • 1,018
  • 2
  • 20
  • 42
5
votes
2 answers

Refresh Token with Google API Java Client Library

I'm using the Google API Java Client http://code.google.com/p/google-api-java-client/ and am able to get the access token successfully for Android. // Google Accounts credential = GoogleAccountCredential.usingOAuth2(this,…
1
2 3
9 10