Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Elixir
  3. oauth2

oauth2

MITElixirv2.1.0

An Elixir library for building OAuth 2.0 client applications with support for multiple authorization strategies.

GitHubGitHub
772 stars139 forks0 contributors

What is oauth2?

OAuth2 is an Elixir client library for implementing OAuth 2.0 authorization flows in applications. It provides a clean, extensible interface for integrating with OAuth 2.0 providers, handling token management, and making authenticated API requests.

Target Audience

Elixir developers building applications that need to authenticate with external OAuth 2.0 providers like GitHub, Google, or custom authorization servers.

Value Proposition

Developers choose OAuth2 for its modular design, adherence to Elixir conventions, and built-in support for multiple grant types without imposing rigid patterns, making it straightforward to add OAuth 2.0 client capabilities.

Overview

An Elixir OAuth 2.0 Client Library

Use Cases

Best For

  • Implementing OAuth 2.0 authorization code flows in Elixir web applications.
  • Building Elixir services that require client credentials grant for machine-to-machine authentication.
  • Creating custom OAuth 2.0 strategies for specific providers like GitHub with extensible serialization.
  • Managing access token retrieval, storage, and refresh flows automatically in Elixir projects.
  • Integrating with OAuth 2.0 providers that use different MIME types like JSON or XML in requests and responses.
  • Developing Elixir applications needing flexible HTTP client configuration via Tesla adapters and middleware.

Not Ideal For

  • Projects requiring OAuth 2.0 server implementation, as this is a client-only library.
  • Applications needing implicit grant or other non-standard OAuth flows not covered by the built-in strategies.
  • Teams looking for pre-configured, drop-in integrations with popular providers without writing custom strategy modules.
  • Rapid prototyping where a higher-level, more opinionated library would reduce boilerplate code and setup time.

Pros & Cons

Pros

Multiple Grant Support

Supports Authorization Code, Password, and Client Credentials flows out of the box, covering common use cases for web and machine-to-machine authentication as highlighted in the README.

Extensible Serialization

Allows configurable serializers for different MIME types like JSON and XML, enabling easy integration with various APIs through modules that implement encode!/1 and decode!/1.

Flexible HTTP Configuration

Built on Tesla with configurable adapters and middleware, providing control over HTTP behavior and compatibility with different backends, as shown in the configuration examples.

Custom Strategy Creation

Enables developers to implement provider-specific strategies, such as for GitHub, by following a straightforward callback module pattern demonstrated in the README.

Cons

Limited Built-in Strategies

Only includes three OAuth 2.0 grant types; projects requiring implicit grant or other flows must implement custom strategies from scratch, adding development overhead.

Dependency on Tesla and Adapters

Requires explicit configuration of Tesla adapters and dependencies like Hackney, adding complexity and potential version conflicts, as noted in the installation and setup sections.

Manual Token Persistence

While it handles token retrieval and refresh, developers must manage token storage and persistence across application restarts themselves, which isn't automated by the library.

Frequently Asked Questions

Quick Stats

Stars772
Forks139
Contributors0
Open Issues1
Last commit1 year ago
CreatedSince 2014

Tags

#elixir#oauth2#authentication#http#authorization#oauth2-client#api-client#hex-package#http-client#tesla

Built With

E
Elixir
H
Hackney
J
Jason

Included in

Elixir13.1k
Auto-fetched 16 hours ago

Related Projects

guardianguardian

Elixir Authentication

Stars3,514
Forks385
Last commit5 months ago
ueberauthueberauth

An Elixir Authentication System for Plug-based Web Applications

Stars1,709
Forks119
Last commit1 month ago
powpow

Robust, modular, and extendable user authentication system

Stars1,668
Forks161
Last commit1 year ago
coherencecoherence

Coherence is a full featured, configurable authentication system for Phoenix

Stars1,259
Forks221
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub