# markbates/goth

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/markbates-goth).**

6,456 stars · 628 forks · Go · mit

## Links

- GitHub: https://github.com/markbates/goth
- Homepage: https://blog.gobuffalo.io/goth-needs-a-new-maintainer-626cd47ca37b
- awesome-repositories: https://awesome-repositories.com/repository/markbates-goth.md

## Description

Goth is a Go library that provides a consistent, provider-agnostic interface for authenticating users through dozens of third-party OAuth and OAuth2 services. It defines a pluggable provider interface and a central registry where providers are registered by name, enabling dynamic lookup and invocation during authentication flows. The library manages the multi-step OAuth authorization process by generating redirect URLs and validating callback responses, and returns a standardized user profile with common fields like email, name, and avatar URL across all supported providers.

The library distinguishes itself through its extensible architecture, allowing developers to implement a custom provider interface to add authentication support for any third-party OAuth service not included by default. It handles session state management between requests using encrypted cookies with configurable security attributes, including HTTP-only, secure, and domain-scoped settings. Goth also supports token refresh, enabling applications to obtain new access tokens using refresh tokens when the original token expires.

The project provides runtime provider registry management, allowing developers to add, retrieve, and clear authentication providers dynamically. Session storage can be customized with settings such as expiry, path, and security flags for production use. The library is distributed as a Go package with documentation covering installation and provider configuration.

## Tags

### Data & Databases

- [Authentication Provider Architectures](https://awesome-repositories.com/f/data-databases/data-compression-algorithms/pluggable-architectures/authentication-provider-architectures.md) — An extensible system where new authentication providers can be added by implementing a simple interface without modifying core logic.

### Development Tools & Productivity

- [OAuth Provider Registrations](https://awesome-repositories.com/f/development-tools-productivity/dynamic-configuration-providers/dynamic-provider-registration/oauth-provider-registrations.md) — Providers are registered by name into a central store, enabling dynamic lookup and invocation during authentication flows.

### Security & Cryptography

- [Provider Registries](https://awesome-repositories.com/f/security-cryptography/authentication-providers/provider-registries.md) — Add, retrieve, and clear authentication providers at runtime for flexible provider management. ([source](https://godoc.org/github.com/markbates/goth))
- [Custom Authentication Providers](https://awesome-repositories.com/f/security-cryptography/custom-authentication-providers.md) — Implement a Provider interface to add authentication support for any third-party OAuth or OAuth2 service not included by default. ([source](https://godoc.org/github.com/markbates/goth))
- [Client-Side Flow Managers](https://awesome-repositories.com/f/security-cryptography/oauth-2-0-authorization-flows/client-side-flow-managers.md) — Managing the authorization process by generating authentication URLs and validating responses from providers.
- [Client-Side Flow Orchestrations](https://awesome-repositories.com/f/security-cryptography/oauth-2-0-authorization-flows/client-side-flow-orchestrations.md) — Manages the multi-step OAuth authorization process by generating redirect URLs and validating callback responses.
- [Session Cookie Security](https://awesome-repositories.com/f/security-cryptography/oauth-authentication/token-encryption/session-cookie-security.md) — Authentication state is persisted between requests using encrypted cookies with configurable security attributes. ([source](https://cdn.jsdelivr.net/gh/markbates/goth@master/README.md))
- [OAuth Providers](https://awesome-repositories.com/f/security-cryptography/oauth-providers.md) — Provides a consistent interface for authenticating users through dozens of third-party OAuth providers.
- [Custom Provider Implementations](https://awesome-repositories.com/f/security-cryptography/oauth-providers/custom-provider-implementations.md) — Implementing a custom interface for any third-party authentication service to handle authorization and user data retrieval.
- [OAuth Session Tracking](https://awesome-repositories.com/f/security-cryptography/session-authentication/oauth-session-tracking.md) — Generate authentication URLs and validate responses from providers to manage the authorization process. ([source](https://godoc.org/github.com/markbates/goth))
- [Multi-Provider Authentication](https://awesome-repositories.com/f/security-cryptography/third-party-authentication-providers/multi-provider-authentication.md) — Ships a unified authentication interface supporting dozens of third-party OAuth and OAuth2 providers.
- [OAuth Profile Normalizers](https://awesome-repositories.com/f/security-cryptography/user-profile-retrieval/oauth-profile-normalizers.md) — Retrieving a normalized user profile with common fields plus raw provider data from any supported OAuth service.
- [Cookie-Based Session Storage](https://awesome-repositories.com/f/security-cryptography/identity-access-management/session-management/custom-session-storage-providers/cookie-based-session-storage.md) — Persisting authentication state between requests using encrypted cookies with configurable security options. ([source](https://cdn.jsdelivr.net/gh/markbates/goth@master/README.md))
- [Refresh Token Grants](https://awesome-repositories.com/f/security-cryptography/oidc-identity-token-issuance/refresh-token-grants.md) — Obtain new access tokens using refresh tokens when the original token expires. ([source](https://godoc.org/github.com/markbates/goth))

### Software Engineering & Architecture

- [OAuth Provider Adapters](https://awesome-repositories.com/f/software-engineering-architecture/cloud-provider-adapters/oauth-provider-adapters.md) — Abstracts provider-specific OAuth implementations behind a single, unified authentication API.
- [OAuth Provider Interfaces](https://awesome-repositories.com/f/software-engineering-architecture/modular-provider-interfaces/oauth-provider-interfaces.md) — Defines a common interface for all OAuth providers, allowing uniform authentication and user data retrieval across different services.
- [OAuth](https://awesome-repositories.com/f/software-engineering-architecture/provider-patterns/oauth.md) — Defines a common interface for all OAuth providers, enabling uniform authentication and user data retrieval across different services.
- [OAuth Provider Registries](https://awesome-repositories.com/f/software-engineering-architecture/provider-patterns/oauth-provider-registries.md) — A central store where providers are registered by name, enabling dynamic lookup and invocation during authentication flows.

### Web Development

- [Authentication Profile Standardization](https://awesome-repositories.com/f/web-development/user-profiles/authentication-profile-standardization.md) — Return a consistent User struct with common fields like email, name, avatar URL, and tokens across all supported providers. ([source](https://godoc.org/github.com/markbates/goth))
- [OAuth Profile Normalizers](https://awesome-repositories.com/f/web-development/user-profiles/authentication-profile-standardization/oauth-profile-normalizers.md) — A library that returns normalized user data with common fields plus raw provider details from any supported OAuth service.

### Networking & Communication

- [OAuth](https://awesome-repositories.com/f/networking-communication/contact-management/user-profile-retrieval/oauth.md) — Retrieves normalized user profile data from various OAuth providers with common fields.

### Part of an Awesome List

- [Security & Privacy](https://awesome-repositories.com/f/awesome-lists/security/security-privacy.md) — Idiomatic OAuth and OAuth2 authentication for multiple providers.
