awesome-repositories.com
博客
MCP
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目MCP 服务器关于排名机制媒体报道
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
golang avatar

golang/oauth2

0
View on GitHub↗
5,872 星标·1,046 分支·Go·BSD-3-Clause·7 次浏览golang.org/x/oauth2↗

Oauth2

This is a Go library for obtaining, refreshing, and attaching OAuth 2.0 access tokens to HTTP requests. It provides a generic token source interface with interchangeable implementations for different OAuth 2.0 grant types, and wraps the Go net/http transport layer to automatically attach access tokens as Authorization headers on outgoing requests.

The library supports the authorization code flow, generating consent page URLs and exchanging authorization codes for tokens. It also implements the device authorization grant for authentication on devices without a browser, and the resource owner password credentials grant for trusted client scenarios. For long-lived credentials, it offers a static token source that always returns the same token.

Token lifecycle management covers acquisition, caching, and automatic refresh using stored refresh tokens. The library caches tokens until they expire, then transparently fetches fresh ones without interrupting the caller. It also provides an authenticated HTTP client that wraps any HTTP client with automatic token injection and refresh.

Features

  • OAuth 2.0 Authorization Flows - A Go library for obtaining, refreshing, and attaching OAuth 2.0 access tokens to HTTP requests.
  • Go Client Libraries - Provides a Go library for obtaining, refreshing, and attaching OAuth 2.0 access tokens to HTTP requests.
  • Authenticated Transports - Attaches access tokens to outgoing HTTP requests by wrapping the transport layer for authenticated communication.
  • Authenticated Request Clients - Wraps an HTTP client with automatic token injection and refresh for every outgoing request.
  • OAuth Token Refreshes - Provides a token source interface with implementations for refresh, caching, and static credentials.
  • Automatic Token Refreshes - Transparently obtains new access tokens using stored refresh tokens when current ones expire.
  • Authorization Code Exchanges - Generates consent page URLs and exchanges authorization codes for access tokens.
  • Automatic Request Token Injection - Adds access tokens as Authorization headers on outgoing HTTP requests made with the Go net/http client.
  • Transport-Level Token Injectors - Wraps the Go net/http transport layer to automatically attach OAuth 2.0 access tokens as Authorization headers.
  • Authorization Code Exchanges - Exchanges authorization codes for access tokens after redirecting users to consent pages.
  • Authorization Code Flow Handlers - Generates consent page URLs and exchanges authorization codes for access tokens.
  • Authorization Code Flow Initiators - Initiates the three-legged OAuth 2.0 authorization code flow with consent URL generation and code exchange.
  • Token Acquisitions - Exchanges authorization codes and credentials for short-lived access tokens and optional refresh tokens.
  • OAuth2 Token Source Suppliers - Provides a generic token source interface with interchangeable implementations for different OAuth 2.0 grant types.
  • Device Authorization Flow Clients - Initiates the OAuth 2.0 device authorization flow by polling for user approval and retrieving tokens.
  • Device Grant Implementations - Implements the OAuth 2.0 Device Authorization Grant for headless devices with polling for user approval.
  • Device Authorization Flow Initiators - Starts the OAuth 2.0 device authorization flow by obtaining a device code and polling for user approval.
  • Device Authorization Polling Clients - Implements the OAuth 2.0 device authorization grant with polling for user approval on browserless devices.
  • Resource Owner Password Credentials Grant Handlers - Exchanges a username and password directly for an access token using the OAuth 2.0 password grant type.
  • Resource Owner Password Grant Handlers - Exchanges a username and password directly for an OAuth 2.0 access token in trusted client scenarios.
  • Authentication Token Caching - Caches authentication tokens across sessions, returning cached tokens until they expire then fetching fresh ones automatically.
  • Cached Token Reuses - Returns cached tokens until they expire, then transparently fetches fresh ones to minimize redundant authorization requests.
  • Static Token Sources - Offers a static token source for long-lived credentials that never expire.
  • Authorization URL Generators - Produces authorization URLs with PKCE challenge and access type parameters for OAuth 2.0 flows.
  • Consent URL Builders - Builds consent page URLs with requested scopes and optional PKCE protection for OAuth 2.0 flows.
  • DevOps & Infrastructure - Standard library for implementing OAuth2 authentication flows.
  • Authentication and Authorization - General OAuth 2.0 client implementation.
  • Security & Privacy - Generic OAuth 2.0 package with support for major providers.

Star 历史

golang/oauth2 的 Star 历史图表golang/oauth2 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

Oauth2 的开源替代方案

相似的开源项目,按与 Oauth2 的功能重合度排序。
  • praw-dev/prawpraw-dev 的头像

    praw-dev/praw

    4,168在 GitHub 上查看↗

    PRAW is a Python wrapper for the Reddit API, functioning as a REST API client and social media data crawler. It provides a programmatic interface to fetch data, manage account content, and interact with the platform. The library implements a comprehensive OAuth 2.0 client supporting multiple authorization flows, including password, implicit, and refresh tokens, as well as read-only guest access. It distinguishes itself through a rate-limit-aware request scheduler that tracks server-side throttling to prevent API quota exhaustion and employs lazy-loading resource objects to fetch data only whe

    Pythonapioauthpraw
    在 GitHub 上查看↗4,168
  • spotipy-dev/spotipyspotipy-dev 的头像

    spotipy-dev/spotipy

    5,450在 GitHub 上查看↗

    Spotipy is a Python client library for interacting with the Spotify Web API. It provides a programmatic interface to manage music data, user accounts, and media playback. The library implements a full OAuth 2.0 client capable of handling authorization codes, client credentials, and implicit grants. It includes a token manager that supports automated token refreshing and pluggable caching backends to maintain stateful sessions. The project covers music metadata retrieval and search, allowing for the lookup of artists, albums, and tracks via resource identifiers and URIs. It also provides capa

    Python
    在 GitHub 上查看↗5,450
  • thephpleague/oauth2-serverthephpleague 的头像

    thephpleague/oauth2-server

    6,650在 GitHub 上查看↗

    This project is a PHP library for implementing a spec-compliant OAuth 2.0 authorization server. It serves as an authentication framework for managing user identities and client authorizations, providing the necessary components to issue and validate access and refresh tokens. The server supports a wide range of standardized authorization flows, including authorization code exchange, device grants, implicit flows, and PKCE enforcement. It handles complex token lifecycles through refresh token rotation, scope management, and the use of asymmetric keys for signing digital tokens. The system pro

    PHPoauthoauth2oauth2-server
    在 GitHub 上查看↗6,650
  • lepture/authliblepture 的头像

    lepture/authlib

    5,346在 GitHub 上查看↗

    Authlib is a comprehensive Python framework for implementing OAuth 1.0, OAuth 2.0, and OpenID Connect clients and servers. It provides a complete toolkit for identity management, spanning the development of authorization servers, resource servers, and client-side integrations. The library distinguishes itself through a full implementation of the JOSE specifications, including JSON Web Tokens, Encryption, Signatures, and Keys. It features specialized capabilities for non-interactive authentication via service account assertion frameworks and a compliance-correction layer designed to handle ide

    Python
    在 GitHub 上查看↗5,346
查看 Oauth2 的所有 30 个替代方案→

常见问题解答

golang/oauth2 是做什么的?

This is a Go library for obtaining, refreshing, and attaching OAuth 2.0 access tokens to HTTP requests. It provides a generic token source interface with interchangeable implementations for different OAuth 2.0 grant types, and wraps the Go net/http transport layer to automatically attach access tokens as Authorization headers on outgoing requests.

golang/oauth2 的主要功能有哪些?

golang/oauth2 的主要功能包括:OAuth 2.0 Authorization Flows, Go Client Libraries, Authenticated Transports, Authenticated Request Clients, OAuth Token Refreshes, Automatic Token Refreshes, Authorization Code Exchanges, Automatic Request Token Injection。

golang/oauth2 有哪些开源替代品?

golang/oauth2 的开源替代品包括: spotipy-dev/spotipy — Spotipy is a Python client library for interacting with the Spotify Web API. It provides a programmatic interface to… praw-dev/praw — PRAW is a Python wrapper for the Reddit API, functioning as a REST API client and social media data crawler. It… thephpleague/oauth2-server — This project is a PHP library for implementing a spec-compliant OAuth 2.0 authorization server. It serves as an… lepture/authlib — Authlib is a comprehensive Python framework for implementing OAuth 1.0, OAuth 2.0, and OpenID Connect clients and… wechatpy/wechatpy — wechatpy is a Python API SDK designed for interacting with official accounts, mini programs, and corporate… thephpleague/oauth2-client — This library is a PHP toolkit for managing OAuth 2.0 authentication flows and connecting applications to external…