A Ruby wrapper for OAuth 2.0, 2.1, and OpenID Connect (OIDC) client implementations.
OAuth2 is a Ruby library that implements the OAuth 2.0, 2.1, and OpenID Connect (OIDC) client specifications. It allows Ruby applications to obtain access tokens from OAuth providers and make authenticated API requests. The gem handles token lifecycle management, multiple authentication grants, and provider-specific requirements.
Ruby developers building applications that need to integrate with third-party OAuth 2.0 or OpenID Connect providers, such as web apps, APIs, or CLI tools requiring secure authentication flows.
Developers choose OAuth2 for its comprehensive RFC compliance, support for modern OAuth 2.1 and OIDC features, and flexible configuration options. It's a mature, well-maintained gem with extensive testing across Ruby implementations, making it a reliable choice for production OAuth client needs.
🔐 oauth2 - A Ruby wrapper for the OAuth 2.0, & 2.1 Authorization Frameworks, including OpenID Connect (OIDC)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements OAuth 2.0, 2.1 draft, and OpenID Connect with features like PKCE and token revocation, ensuring up-to-date protocol handling as highlighted in the Key Features.
Supports multiple client authentication methods including :basic_auth, :request_body, :tls_client_auth, and :private_key_jwt, catering to diverse provider requirements detailed in the configuration section.
Includes built-in logging via OAUTH_DEBUG environment variable and SnakyHash for easy key access, making development and troubleshooting straightforward as shown in the debugging examples.
Tested across MRI, JRuby, and TruffleRuby versions from 2.2 upwards, with a clear compatibility policy ensuring reliability in diverse environments.
While it handles OIDC flows, the gem explicitly states it does not validate id_token signatures, requiring integration with external libraries like 'jwt' gem for secure authentication.
Version 2.0 introduced significant changes like default auth scheme switch and snake_case key conversion, which can break existing implementations without careful migration, as noted in the changelog.
Setting up features like mutual TLS or private_key_jwt authentication involves additional SSL configuration and external key management, adding deployment complexity beyond basic OAuth flows.