Skip to main content
Go SDK for Auth0 The Auth0 Go SDK provides a comprehensive, type-safe interface for integrating Auth0’s Authentication and Management APIs into your Go applications. Built with modern Go practices, the SDK makes it easy to implement secure authentication flows, manage users, configure applications, and perform administrative tasks.

What you’ll build

With the Auth0 Go SDK, you can:

Authenticate users

Implement login, signup, password reset, and OAuth flows with the Authentication API client

Manage resources

Administer users, applications, connections, and tenant settings with the Management API client

Handle tokens

Validate ID tokens, manage refresh tokens, and implement custom token sources

Paginate results

Efficiently retrieve large datasets with built-in pagination support

Authentication API

The Authentication API client enables you to implement user-facing authentication flows:
  • User signup and login - Create new user accounts and authenticate existing users
  • OAuth grants - Support Authorization Code with PKCE, Client Credentials, and other OAuth 2.0 flows
  • Passwordless authentication - Implement email or SMS-based authentication
  • Multi-factor authentication - Add an extra layer of security with MFA
  • Password management - Enable password reset and change functionality
authAPI, err := authentication.New(
    context.Background(),
    "example.us.auth0.com",
    authentication.WithClientID(clientID),
    authentication.WithClientSecret(clientSecret),
)

Management API

The Management API client is designed for backend services and administrative operations:
  • User management - Create, update, search, and delete users
  • Application configuration - Manage Auth0 applications and their settings
  • Connection management - Configure social, enterprise, and database connections
  • Role-based access control - Assign roles and permissions to users
  • Tenant configuration - Customize branding, settings, and security policies
mgmt, err := management.New(
    "example.us.auth0.com",
    option.WithClientCredentials(
        context.Background(),
        clientID,
        clientSecret,
    ),
)

Token management

The SDK provides flexible authentication options:
1

Client credentials

Authenticate using client ID and secret for machine-to-machine communication
2

Static tokens

Use pre-acquired access tokens for quick prototyping or short-lived operations
3

Private Key JWT

Implement secure client authentication using asymmetric keys
4

Custom token sources

Build advanced token management with shared caching and custom refresh logic

Pagination support

The SDK v2 includes built-in pagination with iterator support for seamless data retrieval:
usersPage, err := mgmt.Users.List(ctx, &management.ListUsersRequestParameters{
    PerPage: management.Int(50),
})

iterator := usersPage.Iterator()
for iterator.Next(ctx) {
    user := iterator.Current()
    fmt.Printf("User: %s\n", *user.GetEmail())
}

Requirements

The Auth0 Go SDK follows the same support policy as Go, actively supporting the last two major Go releases.
Go 1.24+ is required. While older versions may work, they are not officially supported.

Get started

Installation

Install the SDK and set up your development environment

Quick start

Build your first integration with step-by-step examples

API reference

Explore the Authentication and Management API reference

Migration guide

Migrate from v1 to v2 of the SDK

Support

Documentation

Learn more about Auth0

GitHub

View source code and contribute

Community

Get help from the community

Build docs developers (and LLMs) love