Library / SDK
googleapis/google-oauth-java-client avatar
googleapis/google-oauth-java-client

google-oauth-java-client: a maintained-mode OAuth library for Java

Google OAuth Client Library for Java

662 stars283 forksJavaApache-2.0

At a glance

What is it?
The Google OAuth Client Library for Java implements OAuth 1.0a and OAuth 2.0 for any web OAuth service, not only Google APIs, and it is built on the Google HTTP Client Library for Java. Google states plainly that the library is in maintenance mode, with non-critical issues closed, so it suits existing code rather than new projects.
Who is it for?
google-oauth-java-client fits an existing Java service that already depends on it and needs its existing integrations to keep compiling, or a team that wants Google's OAuth implementation and HTTP client stack as a foundation. It is the wrong choice for a new project, because the library is in maintenance mode and Google is closing non-critical issues rather than expanding the API.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 7 days ago.
What is it written in?
Mainly Java, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The README opens with a maintenance notice, and it is the most important line

Most library READMEs start with what the library does. This one starts with what has happened to it. The maintenance section says the client library is supported but in maintenance mode only, and that the team is fixing necessary bugs and adding essential features to ensure the library continues to meet your needs for accessing Google APIs. The next sentences are the ones that matter for planning: non-critical issues will be closed, and any issue may be reopened if it is causing ongoing problems.

That is an explicit statement about what kind of contribution will be accepted. Bug fixes that block you, and features you genuinely cannot work around, get attention. Everything else gets closed with a polite summary of the policy.

The implication for an engineer is straightforward. If you already depend on this library, the maintenance mode is not a reason to panic, because the fixes that would keep you unblocked are exactly the ones being made. If you are choosing a library today, you are choosing a codebase where the feature surface is fixed and the roadmap belongs to whoever maintains it, and where a feature you need may never arrive.

The last push to the repository was on 2026-10-16 and the repository is not archived, so this is a maintained project in the sense of receiving fixes. The release tags tell a similar story: v1.37.0 in December 2024, v1.38.0 in February 2025 and v1.39.0 in March 2025, with a version numbering scheme that has stayed on the 1.x line across all three.

The licence is Apache-2.0, with a LICENSE file at the repository root, a SECURITY.md for reporting vulnerabilities, a CODE_OF_CONDUCT.md, and a CONTRIBUTING.md that the README says contributions are welcome against.

It is a general OAuth library, not a Google APIs client

The README makes a distinction that is easy to miss and that determines whether you are looking at the right repository. The library is described as designed to work with any OAuth service on the web, not just with Google APIs. For access to Google APIs specifically, the README points you to the Google APIs Client Library for Java, which is a separate project.

So the division of labour is this. google-oauth-java-client handles the authorization protocol: the OAuth 1.0a and OAuth 2.0 flows, tokens, credentials and the request signing that each standard requires. The APIs client handles the endpoints of a specific Google service, and it is generated from service definitions, so it comes with typed methods for every RPC and a discovery-based model for the rest.

For anyone building against a non-Google OAuth provider, that separation is the reason this library exists at all. There is no equivalent generated client for a third-party provider, so implementing OAuth 1.0a or OAuth 2.0 by hand is the alternative, and hand-rolling OAuth 2.0 means handling token refresh, token revocation, the redirect URI rules and the state parameter yourself.

OAuth 1.0a is the older of the two standards, and it is the one that still comes up in practice for certain service-to-service integrations and for platforms that never moved on. Supporting both in one library is the main reason to prefer it over a narrower one.

It is built on the Google HTTP Client Library for Java, which means the transport layer, the request and response model and the HTTP client configuration are not this project's problem. That is a deliberate layering, and it is also the source of the main operational constraint, since your dependency tree now includes that library and its own dependency tree.

Seven modules in the repository, and what each one is for

The top-level layout is a Maven multi-module project, with a pom.xml at the root and a directory per published artifact.

The core module is google-oauth-client. Around it sit the platform-specific and packaging modules: google-oauth-client-java6, google-oauth-client-appengine for the Google App Engine environment, google-oauth-client-servlet for servlet-based applications, and google-oauth-client-jetty for Jetty. There is a google-oauth-client-assembly module and a google-oauth-client-bom, which is a dependency bill of materials that lets you pin a consistent set of versions across the artifacts rather than resolving them one at a time.

The bom matters more than it sounds. A library with several published modules tends to produce version conflicts in a large dependency tree, and a bom is the standard answer to that. The samples directory contains a module named install-without-bom, which is a good indication that the maintainers consider the distinction worth demonstrating.

The samples are also a map of the use cases. There is a dailymotion-cmdline-sample, which is a non-Google provider, so the general-purpose claim is demonstrated rather than asserted. There is a keycloak-pkce-cmdline-sample, which shows the PKCE flow against a self-hosted identity provider. There is a snippets directory and a snapshot directory, and the samples have their own checkstyle configuration, which means the sample code is held to the same style rules as the library.

The build tooling is visible too. There is a checkstyle.xml with a checkstyle-suppressions.xml, a findbugs-exclude.xml, a clirr-ignored-differences.xml for tracking API compatibility, a versions.txt, a renovate.json for dependency updates, and a .kokoro directory for the CI system.

One piece of the layout is worth calling out for anyone deciding whether to use this: the presence of the java6 module. It is there for compatibility with older runtimes, and it is a signal about the age and the conservatism of the codebase.

Java 7, Android 4.0 and App Engine are the stated supported environments

The README lists the supported Java environments explicitly: Java 7 or higher, Android 4.0 Ice Cream Sandwich or higher, and Google App Engine.

That list is a snapshot of the library's history, and it is worth reading in two ways.

As a compatibility statement, it is generous in the useful direction. A library that still runs on Java 7 and on Android 4.0 can be dropped into a long-lived enterprise application, an old Android build, or a Google App Engine standard environment without an upgrade project. In the Java ecosystem, being able to say that your library still supports the oldest runtime in your fleet is a real constraint met, and this is the main reason many teams keep a dependency they would never choose today.

As a currency statement, it is dated. A library whose documented baseline is a runtime from 2011 and an Android release from 2012 is not going to be using recent language features, and the generated APIs client or a third-party OAuth library that targets a current baseline may be a better fit for new work.

The CI configuration matches the same three generations, with badges for Java 7, Java 8 and Java 11. The Kokoro build system is Google's own CI for Java projects, and the badges point at build status pages for each Java version, so the matrix is visible without reading the build configuration.

For a reader who has to support a mixed estate, the practical takeaway is that this library's compatibility posture is a feature. If your build has to run on Java 8 because of a legacy service boundary, a library that supports Java 7 removes an argument from the upgrade conversation, and that argument is often the one that blocks it.

Where the documentation lives, and what the samples are for

The documentation is spread across several places, and the README lists them. The Developer's Guide and the Setup Instructions are on the googleapis.github.io site, JavaDoc is hosted at googleapis.dev, and there is a samples directory in the repository. Release Notes and the issue tracker are both on GitHub, and the issue tracker is the support channel for questions as well as bugs.

The setup instructions page is the one to read first, because the repository itself does not contain install commands. The README links out rather than inlining a dependency snippet, so the coordinates and the recommended version live on the setup page.

The samples directory is the more interesting part for learning, because it shows the library against real providers rather than a toy. The dailymotion sample uses a provider that has nothing to do with Google, which is the fastest way to see that the general-purpose claim holds. The keycloak sample with PKCE shows the modern authorization code flow with proof key for code exchange against a self-hosted identity provider, which is a different shape from the service account flows most people associate with this library. The install-without-bom sample exists to show the alternative dependency management approach, and the snippets directory collects the smaller fragments.

The samples are separate Maven modules with their own pom.xml and their own checkstyle configuration, so they are built and tested rather than being illustrative fragments that drift out of date.

The absence of an in-repository install snippet is a small thing, but it points at the shape of the project. This is a library with an external documentation site, a multi-module Maven build, and generated API clients sitting next door. It is infrastructure rather than a tutorial, and it assumes you already know how you want to do authorization.

Where google-oauth-java-client is the wrong tool

The first wrong-tool case is a new project that needs a Google API. The README says so directly, pointing to the Google APIs Client Library for Java for that. That client is generated from the service definitions, so it gives you typed methods, and it comes with discovery for the services that are not generated. Choosing the lower-level OAuth library for a Google API project means writing the request plumbing that the generated client already provides.

The second is a project that needs OAuth 2.0 features newer than this library models, or a provider with an unusual flow that the library does not cover. The scope is the two standards the README names, and a provider that layers something on top, or a team that needs the authorization server metadata discovery, will find limits.

The third is a team that needs active development. The maintenance policy is the deciding factor. Non-critical issues get closed, and a feature request is very likely to be closed with the same explanation. If your roadmap depends on a new capability in this library, that is a plan built on someone else's policy decision.

The fourth is a project that has outgrown the Java 7 baseline in the other direction, needing to run on a modern JVM and a recent Android API. The library still works, but you are carrying a compatibility posture you no longer need, and its dependency on the Google HTTP Client Library is one more thing to track in your dependency management.

The fifth is a service-to-service integration where OAuth 2.0 client credentials is all you need, and a full library with token refresh, a servlet module and a Jetty module is more surface than the problem. The samples and the module list are the evidence here: this library is built for the full breadth of the authorization problem, including the parts a server-side service usually does not need.

The alternative worth naming is a provider-specific SDK, where the provider maintains its own client. Those often wrap this library or a similar one, which is the difference in approach: the provider SDK encodes that provider's quirks and gives you a narrower, better-fitting API, while this library stays protocol-general and leaves those quirks to you.

Editorial conclusion

google-oauth-java-client fits an existing Java service that already depends on it and needs its existing integrations to keep compiling, or a team that wants Google's OAuth implementation and HTTP client stack as a foundation. It is the wrong choice for a new project, because the library is in maintenance mode and Google is closing non-critical issues rather than expanding the API. Before adopting it, read the maintenance note in the README first, check the setup instructions for the dependency coordinates and the Java version you are on, and decide deliberately whether the generated APIs client is the better fit for a Google API project.

Frequently asked questions

Is the Google OAuth Client Library for Java still maintained?

It is supported but in maintenance mode only, and the README states that the team fixes necessary bugs and adds essential features, that non-critical issues will be closed, and that any issue may be reopened if it is causing ongoing problems.

Can I use google-oauth-java-client with providers other than Google?

Yes, the README states the library is designed to work with any OAuth service on the web, not just with Google APIs, and the samples include a Dailymotion command line sample.

Which Java versions does google-oauth-java-client support?

The README lists Java 7 or higher, Android 4.0 Ice Cream Sandwich or higher, and Google App Engine, and the CI badges show builds for Java 7, Java 8 and Java 11.

Which library should I use for Google APIs?

The README points to the Google APIs Client Library for Java for access to Google APIs, and this library is for the OAuth authorization layer itself.

Official sources

  1. googleapis/google-oauth-java-client on GitHub
  2. Issues
  3. License: Apache-2.0
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/googleapis-google-oauth-java-client.svg)](https://hysenlabs.com/projects/googleapis-google-oauth-java-client)

Was this useful?