![]() |
VOOZH | about |
dotnet add package Auth0.ManagementApi --version 8.5.0
NuGet\Install-Package Auth0.ManagementApi -Version 8.5.0
<PackageReference Include="Auth0.ManagementApi" Version="8.5.0" />
<PackageVersion Include="Auth0.ManagementApi" Version="8.5.0" />Directory.Packages.props
<PackageReference Include="Auth0.ManagementApi" />Project file
paket add Auth0.ManagementApi --version 8.5.0
#r "nuget: Auth0.ManagementApi, 8.5.0"
#:package Auth0.ManagementApi@8.5.0
#addin nuget:?package=Auth0.ManagementApi&version=8.5.0Install as a Cake Addin
#tool nuget:?package=Auth0.ManagementApi&version=8.5.0Install as a Cake Tool
👁 Auth0.ManagementApi NuGet
👁 Auth0.ManagementApi Downloads
👁 Auth0.AuthenticationApi NuGet
👁 Auth0.AuthenticationApi Downloads
👁 License
👁 Build and Test
👁 fern shield
📚 Documentation - 🚀 Getting Started - 💻 API Reference - 💬 Feedback
This library supports .NET Standard 2.0 and .NET Framework 4.6.2 as well as later versions of both.
Install-Package Auth0.ManagementApi
The recommended way to use the Management API is with the ManagementClient wrapper, which provides automatic token management and a simpler configuration experience.
The ManagementClient wrapper abstracts token management through an ITokenProvider. Choose the built-in provider that fits your scenario, or implement the interface for full control.
Client credentials (recommended for server-to-server — tokens are acquired and refreshed automatically):
var client = new ManagementClient(new ManagementClientOptions
{
Domain = "YOUR_AUTH0_DOMAIN",
TokenProvider = new ClientCredentialsTokenProvider(
domain: "YOUR_AUTH0_DOMAIN",
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET"
)
});
// Tokens are automatically acquired and refreshed
var users = await client.Users.GetAllAsync();
Note: The domain is specified twice — once in
ManagementClientOptions(to build the base API URLhttps://{domain}/api/v2) and once inClientCredentialsTokenProvider(to build the token endpoint URLhttps://{domain}/oauth/token). Both must match your Auth0 tenant domain.
Already have a token? Use
ManagementApiClientdirectly:var client = new ManagementApiClient( token: "your-access-token", clientOptions: new ClientOptions { BaseUrl = "https://YOUR_AUTH0_DOMAIN/api/v2" });
Async delegate (retrieve tokens from an external source such as a secret manager):
var client = new ManagementClient(new ManagementClientOptions
{
Domain = "YOUR_AUTH0_DOMAIN",
TokenProvider = new DelegateTokenProvider(ct => secretManager.GetSecretAsync("auth0-token", ct))
});
Additional configuration options:
var client = new ManagementClient(new ManagementClientOptions
{
Domain = "YOUR_AUTH0_DOMAIN",
TokenProvider = new ClientCredentialsTokenProvider(
domain: "YOUR_AUTH0_DOMAIN",
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET",
audience: "https://custom-audience/" // Optional: defaults to https://{domain}/api/v2/
),
Timeout = TimeSpan.FromSeconds(60), // Optional: request timeout
MaxRetries = 3, // Optional: retry attempts
HttpClient = customHttpClient, // Optional: bring your own HttpClient
AdditionalHeaders = new Dictionary<string, string> // Optional: custom headers
{
{ "X-Custom-Header", "value" }
}
});
If you prefer to manage tokens yourself, you can use the ManagementApiClient directly. Generate a token for the API calls you wish to make (see Access Tokens for the Management API):
var client = new ManagementApiClient(
token: "your-access-token",
clientOptions: new ClientOptions { BaseUrl = "https://YOUR_AUTH0_DOMAIN/api/v2" }
);
The API calls are divided into groups which correlate to the Management API documentation. For example all Connection related methods can be found under the Connections property. So to get a list of all database (Auth0) connections, you can make the following API call:
await client.Connections.GetAllAsync("auth0");
See .
Install-Package Auth0.AuthenticationApi
To use the Authentication API, create a new instance of the AuthenticationApiClient class, passing in the URL of your Auth0 instance, e.g.:
var client = new AuthenticationApiClient(new Uri("https://YOUR_AUTH0_DOMAIN"));
This library contains URL Builders which will assist you with constructing an authentication URL, but does not actually handle the authentication/authorization flow for you. It is suggested that you refer to the Quickstart tutorials for guidance on how to implement authentication for your specific platform.
Important note on state validation: If you choose to use the AuthorizationUrlBuilder to construct the authorization URL and implement a login flow callback yourself, it is important to generate and store a state value (using WithState) and validate it in your callback URL before exchanging the authorization code for the tokens.
See .
Access raw HTTP response data (status code, headers, URL) alongside parsed response data using the .WithRawResponse() method.
using Auth0.ManagementApi;
// Access raw response data (status code, headers, etc.) alongside the parsed response
var result = await client.Users.CreateAsync(
new CreateUserRequestContent
{
Email = "user@example.com",
Connection = "Username-Password-Authentication"
}
).WithRawResponse();
// Access the parsed data
var user = result.Data;
// Access raw response metadata
var statusCode = result.RawResponse.StatusCode;
var headers = result.RawResponse.Headers;
var url = result.RawResponse.Url;
// Access specific headers (case-insensitive)
if (headers.TryGetValue("X-Request-Id", out var requestId))
{
Console.WriteLine($"Request ID: {requestId}");
}
// For the default behavior, simply await without .WithRawResponse()
var user = await client.Users.CreateAsync(
new CreateUserRequestContent
{
Email = "user@example.com",
Connection = "Username-Password-Authentication"
}
);
The SDK uses Optional<T> for fields that need to distinguish between "not set" (undefined) and "explicitly set to null". This is important for PATCH/update operations where you want to:
using Auth0.ManagementApi;
using Auth0.ManagementApi.Core;
// Update only the name, leave other fields unchanged
var request = new UpdateUserRequestContent
{
Name = "John Doe" // Will be sent
// Email, PhoneNumber, etc. are Optional<string?>.Undefined by default - won't be sent
};
// Explicitly clear a field by setting it to null
var clearNickname = new UpdateUserRequestContent
{
Nickname = Optional<string?>.Of(null) // Will send null to clear the nickname
};
// Check if a value is defined
if (request.Name.IsDefined)
{
Console.WriteLine($"Name will be updated to: {request.Name.Value}");
}
// Use TryGetValue for safe access
if (request.Email.TryGetValue(out var email))
{
Console.WriteLine($"Email: {email}");
}
else
{
Console.WriteLine("Email is not being updated");
}
The SDK provides interfaces for all clients, enabling dependency injection and testing scenarios:
using Auth0.ManagementApi;
public class UserService
{
private readonly IManagementApiClient _client;
public UserService(IManagementApiClient client)
{
_client = client;
}
public async Task<GetUserResponseContent> GetUserAsync(string userId)
{
return await _client.Users.GetAsync(userId, new GetUserRequestParameters());
}
}
// Register with dependency injection
services.AddSingleton<IManagementApiClient>(provider =>
{
return new ManagementClient(new ManagementClientOptions
{
Domain = "YOUR_AUTH0_DOMAIN",
TokenProvider = new ClientCredentialsTokenProvider(
domain: "YOUR_AUTH0_DOMAIN",
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET"
)
});
});
Sub-clients also have interfaces (e.g., IUsersClient, IConnectionsClient) for more granular mocking:
// Mock specific sub-clients for unit testing
var mockUsersClient = new Mock<IUsersClient>();
mockUsersClient
.Setup(c => c.GetAsync(It.IsAny<string>(), It.IsAny<GetUserRequestParameters>(), null, default))
.ReturnsAsync(new GetUserResponseContent { UserId = "user_123" });
We appreciate feedback and contribution to this repo! Before you get started, please see the following:
To provide feedback or report a bug, please raise an issue on our issue tracker.
Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
<p align="center"> <picture> <source media="(prefers-color-scheme: light)" srcset="https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png" width="150"> <source media="(prefers-color-scheme: dark)" srcset="https://cdn.auth0.com/website/sdks/logos/auth0_dark_mode.png" width="150"> <img alt="Auth0 Logo" src="https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png" width="150"> </picture> </p> <p align="center">Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout <a href="https://auth0.com/why-auth0">Why Auth0?</a></p> <p align="center"> This project is licensed under the MIT license. See the <a href="./LICENSE"> LICENSE</a> file for more info.</p>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Auth0.ManagementApi:
| Package | Downloads |
|---|---|
|
Auth0Net.DependencyInjection
Dependency Injection, HttpClientFactory & ASP.NET Core extensions for Auth0.NET |
|
|
Ark.Tools.AspNetCore.Auth0
Extensions of Auth0 for AspNetCore |
|
|
Ark.Tools.AspNetCore
Tools and base classes for AspNetCore as in Ark-way of using it |
|
|
N3O.Umbraco.Authentication.Auth0
TODO |
|
|
Ark.Tools.Auth0
Extensions of Auth0 |
Showing the top 1 popular GitHub repositories that depend on Auth0.ManagementApi:
| Repository | Stars |
|---|---|
|
Ivy-Interactive/Ivy-Framework
The ultimate framework for building internal tools with LLM code generation by unifying front-end and back-end into a single C# codebase.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 8.5.0 | 7,950 | 6/10/2026 |
| 8.4.0 | 17,293 | 5/28/2026 |
| 8.3.0 | 24,137 | 5/13/2026 |
| 8.2.0 | 31,169 | 4/30/2026 |
| 8.1.0 | 35,270 | 4/9/2026 |
| 8.0.0 | 14,179 | 4/2/2026 |
| 8.0.0-beta.1 | 175 | 3/2/2026 |
| 8.0.0-beta.0 | 1,351 | 2/4/2026 |
| 7.47.0 | 147,236 | 4/9/2026 |
| 7.46.0 | 70,970 | 3/26/2026 |
| 7.45.1 | 138,373 | 3/5/2026 |
| 7.45.0 | 39,845 | 2/25/2026 |
| 7.44.0 | 191,741 | 1/29/2026 |
| 7.43.1 | 94,897 | 1/15/2026 |
| 7.43.0 | 262,483 | 12/5/2025 |
| 7.42.0 | 428,692 | 10/9/2025 |
| 7.41.0 | 176,038 | 9/15/2025 |
| 7.40.0 | 225,793 | 8/13/2025 |
| 7.39.0 | 487,410 | 7/8/2025 |
| 7.38.0 | 137,168 | 6/23/2025 |