skillfed

google-oauth

OAuth2 for Google APIs

google-oauth v1.0.1 251.0K downloads/30d#8,607 on PyPI4
Permissive license MIT License Abandoned released

What it is and what it does

google-oauth is a Python library that handles OAuth2 authentication for Google service accounts, allowing server-to-server communication with Google APIs. It supports creating service account objects from JSON or PKCS12 credentials and provides methods to obtain and use OAuth2 access tokens. The library wraps the requests library to automatically attach proper Authorization headers to API calls.

The package implements only the service account (two-legged) OAuth2 flow, not the three-legged flow for web applications. It caches access tokens to avoid unnecessary token requests and provides a convenient shortcut method for making authenticated API calls. However, the package has been abandoned since its initial release in March 2016 and receives no maintenance, meaning it may not work with current Google API changes or modern Python security practices.

Use it for:

  • Authenticate a backend service to call Google APIs (e.g., Google+ search, Gmail) without user interaction
  • Automate Google API calls from a scheduled job or daemon using service account credentials
  • Build a microservice that needs to access Google APIs with a fixed set of scopes and permissions
  • Implement JWT-based authentication for Google service accounts in legacy Python 2/3 codebases

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Implements Google OAuth2 authentication for service accounts, enabling server-to-server API access using JSON or PKCS12 credentials.

No. The package is abandoned (last release 2016-03-28, no commits since 2016-08-06) and will not receive security updates or compatibility fixes. High install friction from pyOpenSSL dependencies and lack of support for modern Python versions make it a poor choice for new projects. Use the official google-auth library instead.

Install

google-oauth on PyPI

pip

pip install google-oauth

uv

uv add google-oauth

poetry

poetry add google-oauth

Installing google-oauth

Before you install

High install friction due to pyOpenSSL build dependency requiring system-level OpenSSL headers (libssl-dev on Debian). Package is abandoned as of 2016-08-06 with no maintenance since initial release.

License in practice

MIT License permits commercial and private use with minimal restrictions, making it legally safe to adopt if you accept the maintenance risk.

Quickstart

pip install google-oauth

import json
from google_oauth import ServiceAccount

key = json.load(open('/path/to/credentials.json'))
auth = ServiceAccount.from_json(key=key, scopes=['https://www.googleapis.com/auth/plus.login'])
token = auth.access_token

Requires pyOpenSSL build dependencies; on Debian-based systems install libssl-dev. Package supports Python 2.7 or 3.3+.

Verify before relying

  • Whether the package works with current Google OAuth2 API endpoints and security standards
  • Compatibility with modern Python versions beyond 3.3+
  • Whether access tokens are properly refreshed or if manual refresh is required

Package facts

License MIT License (permissive)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 3,791 days since the last release
Last repo commit
First released
Downloads 250,965/month — #8,607 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Keywords: google, oauth, oauth2, api, service, jwt

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Internet

Tags

google oauth2 service accountgoogle api authenticationserver to server oauthgoogle service account jwtgoogle api access tokenoauth2 google credentialsgoogle service authentication
oauth2google-apisabandoned

More Internet packages