
📚 Documentation - 🚀 Getting Started - 💻 API Reference - 💬 Feedback
Documentation
- Docs site - explore our docs site and learn more about Auth0.
Getting started
Requirements
This library supports .NET Standard 2.0 and .NET Framework 4.6.2 as well as later versions of both.
Management API
Installation
Install-Package Auth0.ManagementApi
Usage
The recommended way to use the Management API is with the ManagementClient wrapper, which provides automatic token management and a simpler configuration experience:
var client = new ManagementClient(new ManagementClientOptions
{
Domain = "YOUR_AUTH0_DOMAIN",
ClientId = "YOUR_CLIENT_ID",
ClientSecret = "YOUR_CLIENT_SECRET"
});
// Tokens are automatically acquired and refreshed
var users = await client.Users.ListAsync(new ListUsersRequestParameters());
You can also use a static token or a dynamic token provider:
// With a static token
var client = new ManagementClient(new ManagementClientOptions
{
Domain = "YOUR_AUTH0_DOMAIN",
Token = "your-access-token"
});
// With a dynamic token provider (e.g., from a vault or external service)
var client = new ManagementClient(new ManagementClientOptions
{
Domain = "YOUR_AUTH0_DOMAIN",
TokenProvider = () => GetTokenFromVault()
});
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:
var connections = await client.Connections.ListAsync(new ListConnectionsQueryParameters
{
Strategy = new List<ConnectionStrategyEnum?> { ConnectionStrategyEnum.Auth0 }
});
Authentication API
Installation
Install-Package Auth0.AuthenticationApi
Usage
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"));
Authentication
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.
Feedback
Contributing
We appreciate feedback and contribution to this repo! Before you get started, please see the following:
Raise an issue
To provide feedback or report a bug, please raise an issue on our issue tracker.
Vulnerability Reporting
Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout Why Auth0?
This project is licensed under the MIT license. See the LICENSE file for more info.