### Install Auth0.AuthenticationApi Package
Source: https://github.com/auth0/auth0.net/blob/master/README.md
Use this command to install the Auth0.AuthenticationApi NuGet package.
```powershell
Install-Package Auth0.AuthenticationApi
```
--------------------------------
### Restore Project Dependencies
Source: https://github.com/auth0/auth0.net/blob/master/CONTRIBUTING.md
Use this command to install all necessary project dependencies before building or testing.
```bash
dotnet restore
```
--------------------------------
### Install Auth0.ManagementApi Package
Source: https://github.com/auth0/auth0.net/blob/master/README.md
Use this command to install the Auth0.ManagementApi NuGet package for your .NET project.
```powershell
Install-Package Auth0.ManagementApi
```
--------------------------------
### Make an API Call to Get Auth0 Connections
Source: https://github.com/auth0/auth0.net/blob/master/README.md
Example of making an API call to retrieve all Auth0 (database) connections using the ManagementApiClient.
```csharp
await client.Connections.GetAllAsync("auth0");
```
--------------------------------
### Restore and Build Auth0.NET
Source: https://github.com/auth0/auth0.net/blob/master/DEVELOPMENT.md
Use these commands to restore project dependencies and build the library. Ensure the .NET Core SDK is installed.
```bash
dotnet restore
dotnet build
```
--------------------------------
### GetAsync
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Get the supplemental signals configuration for a tenant.
```APIDOC
## GetAsync
### Description
Get the supplemental signals configuration for a tenant.
### Method
GET (implied)
### Endpoint
/supplemental-signals (implied)
### Usage
```csharp
await client.SupplementalSignals.GetAsync();
```
### Response
#### Success Response (200)
- **configuration** (GetSupplementalSignalsResponseContent) - The supplemental signals configuration.
```
--------------------------------
### List SCIM Configurations
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieve a list of SCIM configurations for a tenant. Use this to get an overview of all SCIM configurations.
```csharp
await client.Connections.ScimConfiguration.ListAsync(
new ListScimConfigurationsRequestParameters { From = "from", Take = 1 }
);
```
--------------------------------
### Auth0 Management API NuGet Package Reference (v8)
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Example of how to reference the Auth0.ManagementApi NuGet package in version 8.
```xml
```
--------------------------------
### Auth0 Management API NuGet Package Reference (v7)
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Example of how to reference the Auth0.ManagementApi NuGet package in version 7.
```xml
```
--------------------------------
### Client Initialization (v7 vs v8)
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Compares client initialization between v7 (manual token) and v8 (automatic token management with ManagementClient).
```csharp
// Old (v7)
var token = await GetAccessTokenAsync();
var client = new ManagementApiClient(token, new Uri("https://YOUR_DOMAIN/api/v2"));
// New (v8) - Recommended with automatic token management
var client = new ManagementClient(new ManagementClientOptions
{
Domain = "YOUR_DOMAIN",
TokenProvider = new ClientCredentialsTokenProvider(
domain: "YOUR_DOMAIN",
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET"
)
});
```
--------------------------------
### Get Universal Login Branding Template
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves the current Universal Login branding template. No specific setup is required beyond having an authenticated client.
```csharp
await client.Branding.Templates.GetUniversalLoginAsync();
```
--------------------------------
### Client/Application Management: Creating a Client (v8)
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Illustrates how to create a new client application in v8 using `CreateClientRequestContent` and `client.Clients.CreateAsync`.
```APIDOC
## POST /api/v2/clients
### Description
Creates a new client application.
### Method
POST
### Endpoint
/api/v2/clients
### Request Body
- **Name** (string) - Required - The name of the client application.
- **AppType** (ClientAppTypeEnum) - Required - The type of the application (e.g., Spa).
- **Callbacks** (string[]) - Optional - A list of valid callback URLs for the application.
### Request Example
```csharp
var request = new CreateClientRequestContent
{
Name = "My Application",
AppType = ClientAppTypeEnum.Spa,
Callbacks = new[] { "https://myapp.com/callback" }
};
CreateClientResponseContent app = await client.Clients.CreateAsync(request);
```
### Response
#### Success Response (200)
- **ClientId** (string) - The unique identifier for the created client.
```
--------------------------------
### Retrieve Breached Password Detection Settings
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Use this method to get the current configuration for Breached Password Detection. No specific setup is required beyond having an authenticated client.
```csharp
await client.AttackProtection.BreachedPasswordDetection.GetAsync();
```
--------------------------------
### Get Tenant Settings
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieve tenant settings, with options to specify fields to include or exclude. Use this to view current tenant configurations.
```csharp
await client.Tenants.Settings.GetAsync(
new GetTenantSettingsRequestParameters { Fields = "fields", IncludeFields = true }
);
```
--------------------------------
### Retrieve Phone Factor Templates
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Use this method to get the current multi-factor authentication enrollment and verification templates for phone factors. No setup is required beyond having an authenticated client.
```csharp
await client.Guardian.Factors.Phone.GetTemplatesAsync();
```
--------------------------------
### Auth0 Management Client Initialization (v8 - Automatic Token Management)
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Demonstrates the recommended v8 approach using ManagementClient for automatic token acquisition and refresh via client credentials.
```csharp
using Auth0.ManagementApi;
// Automatic token acquisition and refresh via client credentials
var client = new ManagementClient(new ManagementClientOptions
{
Domain = "YOUR_DOMAIN",
TokenProvider = new ClientCredentialsTokenProvider(
domain: "YOUR_DOMAIN",
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET")
});
```
--------------------------------
### Get New Device Risk Assessment Settings
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves the current risk assessment settings for the new device assessor. No specific setup is required beyond having an authenticated client instance.
```csharp
await client.RiskAssessments.Settings.NewDevice.GetAsync();
```
--------------------------------
### User Management: Creating a User (v8)
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Demonstrates how to create a new user in v8 using the `CreateUserRequestContent` object and the `client.Users.CreateAsync` method.
```APIDOC
## POST /api/v2/users
### Description
Creates a new user in Auth0.
### Method
POST
### Endpoint
/api/v2/users
### Request Body
- **Email** (string) - Required - The email address of the user.
- **Connection** (string) - Required - The connection to use for the user.
- **Password** (string) - Optional - The user's password.
- **EmailVerified** (boolean) - Optional - Whether the user's email has been verified.
### Request Example
```csharp
var request = new CreateUserRequestContent
{
Email = "newuser@example.com",
Connection = "Username-Password-Authentication",
Password = "SecureP@ssw0rd!",
EmailVerified = true
};
var user = await client.Users.CreateAsync(request);
```
### Response
#### Success Response (200)
- **UserId** (string) - The unique identifier for the created user.
```
--------------------------------
### Get Log Stream using Auth0 .NET SDK
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Example of how to retrieve a log stream configuration using the Auth0 Management API client in C#. Requires the log stream ID as a parameter.
```csharp
await client.LogStreams.GetAsync("id");
```
--------------------------------
### Auth0 Management Client Initialization (v8 - Custom Token Provider)
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Shows how to implement and use a custom ITokenProvider for alternative token acquisition strategies in v8.
```csharp
using Auth0.ManagementApi;
// Or implement ITokenProvider for any other strategy
var client = new ManagementClient(new ManagementClientOptions
{
Domain = "YOUR_DOMAIN",
TokenProvider = new MyCustomTokenProvider()
});
```
--------------------------------
### Build the Project
Source: https://github.com/auth0/auth0.net/blob/master/CONTRIBUTING.md
Compile the entire project to ensure all components are built successfully.
```bash
dotnet build
```
--------------------------------
### Auth0 Management Client Initialization (v8 - Pre-obtained Token)
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Shows how to initialize ManagementApiClient in v8 using a pre-obtained access token.
```csharp
using Auth0.ManagementApi;
// Use a pre-obtained access token directly — no wrapper needed
var client = new ManagementApiClient(
token: "YOUR_ACCESS_TOKEN",
clientOptions: new ClientOptions { BaseUrl = "https://YOUR_DOMAIN/api/v2" });
```
--------------------------------
### Initialize ManagementClient with Options
Source: https://github.com/auth0/auth0.net/blob/master/docs-source/index.md
Initialize the ManagementClient with your Auth0 domain, client ID, and client secret. Tokens are automatically managed.
```csharp
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());
```
--------------------------------
### Get Supplemental Signals Configuration
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Get the current supplemental signals configuration for a tenant. This method does not require any parameters.
```csharp
await client.SupplementalSignals.GetAsync();
```
--------------------------------
### Get Connection Profile Template
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves a specific Connection Profile Template by its ID. Use this to get details about a particular template.
```csharp
await client.ConnectionProfiles.GetTemplateAsync("id");
```
--------------------------------
### Captcha.GetAsync
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Get the CAPTCHA configuration for your client.
```APIDOC
## GetCaptchaConfiguration
### Description
Get the CAPTCHA configuration for your client.
### Method
GET
### Endpoint
/api/v2/attack-protection/captcha
### Parameters
None
### Response
#### Success Response (200)
- **settings** (object) - The CAPTCHA configuration settings.
### Response Example
```json
{
"enabled": true,
"threshold": 10
}
```
```
--------------------------------
### client.Prompts.GetSettingsAsync
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieve details of the Universal Login configuration of your tenant. This includes the Identifier First Authentication and WebAuthn with Device Biometrics for MFA features.
```APIDOC
## Get Universal Login Settings
### Description
Retrieve details of the Universal Login configuration of your tenant. This includes the Identifier First Authentication and WebAuthn with Device Biometrics for MFA features.
### Method
GET
### Endpoint
/prompts/settings
### Parameters
None
### Request Example
```csharp
await client.Prompts.GetSettingsAsync();
```
### Response
#### Success Response (200)
- **content** (GetSettingsResponseContent) - The Universal Login settings.
```
--------------------------------
### List Directory Provisioning Configurations
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieve a paginated list of directory provisioning configurations for a tenant. Specify 'From' and 'Take' parameters for pagination.
```csharp
await client.Connections.DirectoryProvisioning.ListAsync(
new ListDirectoryProvisioningsRequestParameters { From = "from", Take = 1 }
);
```
--------------------------------
### Create Client: v7 vs v8
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Compares the C# code for creating a client application in Auth0 .NET SDK v7 and v8. Key differences include request object naming and enum types for application type.
```csharp
var request = new ClientCreateRequest
{
Name = "My Application",
ApplicationType = ClientApplicationType.Spa,
Callbacks = new List { "https://myapp.com/callback" }
};
Client app = await client.Clients.CreateAsync(request);
```
```csharp
var request = new CreateClientRequestContent
{
Name = "My Application",
AppType = ClientAppTypeEnum.Spa,
Callbacks = new[] { "https://myapp.com/callback" }
};
CreateClientResponseContent app = await client.Clients.CreateAsync(request);
```
--------------------------------
### Get Organization Connection
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves a specific connection associated with an organization.
```APIDOC
## Get Organization Connection
### Description
Retrieves a specific connection associated with an organization.
### Method
GET
### Endpoint
/api/v2/organizations/{id}/connections/{connectionId}
### Parameters
#### Path Parameters
- **id** (string) - Required - Organization identifier.
- **connectionId** (string) - Required - Connection identifier.
### Response
#### Success Response (200)
- **id** (string) - The identifier of the organization connection.
- **name** (string) - The name of the connection.
- **enabled** (boolean) - Whether the connection is enabled.
- **assign_membership_on_login** (boolean) - Whether to assign membership on login.
- **show_as_button** (boolean) - Whether to show the connection as a button.
- **is_social** (boolean) - Whether the connection is a social connection.
- **metadata** (object) - Metadata for the connection.
```
--------------------------------
### GetAsync
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Gets the connection keys for the Okta or OIDC connection strategy.
```APIDOC
## GetAsync
### Description
Gets the connection keys for the Okta or OIDC connection strategy.
### Method
GET
### Endpoint
/api/v2/connections/{id}/keys
### Parameters
#### Path Parameters
- **id** (string) - Required - ID of the connection
### Response
#### Success Response (200)
- **keys** (IEnumerable) - Description of the keys returned
### Response Example
{
"example": "[\n {\n \"kid\": \"example_kid_1\",\n \"alg\": \"RS256\"\n },\n {\n \"kid\": \"example_kid_2\",\n \"alg\": \"RS256\"\n }\n]"
}
```
--------------------------------
### Get User Attribute Profile
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves a single User Attribute Profile by its ID.
```APIDOC
## Get User Attribute Profile
### Description
Retrieves a single User Attribute Profile specified by ID.
### Method
GET
### Endpoint
/api/v2/user-attribute-profiles/{id}
### Parameters
#### Path Parameters
- **id** (string) - Required - ID of the user-attribute-profile to retrieve.
### Request Example
```
GET /api/v2/user-attribute-profiles/id
```
### Response
#### Success Response (200)
- **id** (string) - The unique identifier for the user attribute profile.
- **name** (string) - The name of the user attribute profile.
- **user_id** (string) - The ID of the user associated with this profile.
- **user_attributes** (object) - A key-value map of user attributes.
#### Response Example
```json
{
"id": "string",
"name": "string",
"user_id": "string",
"user_attributes": {}
}
```
```
--------------------------------
### Initialize Management Client with Client Credentials
Source: https://github.com/auth0/auth0.net/blob/master/Examples.md
Recommended way to initialize the Management API client using client credentials for automatic token management. Ensure you have the Auth0.ManagementApi NuGet package installed.
```csharp
using Auth0.ManagementApi;
public async Task Initialize()
{
var client = new ManagementClient(new ManagementClientOptions
{
Domain = "my.custom.domain",
TokenProvider = new ClientCredentialsTokenProvider(
domain: "my.custom.domain",
clientId: "clientId",
clientSecret: "clientSecret"
)
});
// Tokens are acquired and refreshed automatically
var users = await client.Users.ListAsync(new ListUsersRequestParameters());
}
```
--------------------------------
### Get Default Custom Domain
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves the tenant's default custom domain.
```csharp
await client.CustomDomains.GetDefaultAsync();
```
--------------------------------
### Manual Pagination (v7)
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Demonstrates manual pagination using IPagedList in v7. Requires manual fetching of subsequent pages.
```csharp
var request = new GetUsersRequest { Query = "email:*@example.com" };
var pagination = new PaginationInfo(pageNo: 0, perPage: 50, includeTotals: true);
IPagedList users = await client.Users.GetAllAsync(request, pagination);
int totalUsers = users.Paging.Total; // Total count available directly
foreach (var user in users)
{
Console.WriteLine(user.Email);
}
// Manual next-page fetch
var nextPage = new PaginationInfo(pageNo: 1, perPage: 50, includeTotals: true);
IPagedList page2 = await client.Users.GetAllAsync(request, nextPage);
```
--------------------------------
### Get Auth0 Action by ID
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieve a specific action using its unique identifier.
```csharp
await client.Actions.GetAsync("id");
```
--------------------------------
### CreateAsync
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Create a directory provisioning configuration for a connection.
```APIDOC
## CreateAsync
### Description
Create a directory provisioning configuration for a connection.
### Method
POST
### Endpoint
/api/v2/connections/{id}/provisioning-connections
### Parameters
#### Path Parameters
- **id** (string) - Required - The ID of the connection to create its directory provisioning configuration.
#### Request Body
- **name** (string) - Required - The name of the provisioning configuration.
- **type** (string) - Required - The type of the provisioning configuration (e.g., "SAML", "LDAP").
- **settings** (object) - Optional - Specific settings for the provisioning configuration.
### Request Example
```json
{
"name": "NewProvisioningConfig",
"type": "SAML",
"settings": {
"entity_id": "https://example.com/entity"
}
}
```
### Response
#### Success Response (201)
- **id** (string) - The ID of the newly created provisioning configuration.
- **name** (string) - The name of the provisioning configuration.
- **type** (string) - The type of the provisioning configuration.
- **created_at** (string) - The timestamp when the configuration was created.
- **updated_at** (string) - The timestamp when the configuration was last updated.
### Response Example
```json
{
"id": "prov_456",
"name": "NewProvisioningConfig",
"type": "SAML",
"created_at": "2023-01-02T10:00:00Z",
"updated_at": "2023-01-02T10:00:00Z"
}
```
```
--------------------------------
### Connection Management: Creating a Connection (v8)
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Details how to create a new connection in v8 using `CreateConnectionRequestContent` and `client.Connections.CreateAsync`.
```APIDOC
## POST /api/v2/connections
### Description
Creates a new connection.
### Method
POST
### Endpoint
/api/v2/connections
### Request Body
- **Name** (string) - Required - The name of the connection.
- **Strategy** (ConnectionIdentityProviderEnum) - Required - The identity provider strategy for the connection (e.g., Auth0).
### Request Example
```csharp
var request = new CreateConnectionRequestContent
{
Name = "my-database",
Strategy = ConnectionIdentityProviderEnum.Auth0
};
CreateConnectionResponseContent connection = await client.Connections.CreateAsync(request);
```
### Response
#### Success Response (200)
- **Id** (string) - The unique identifier for the created connection.
```
--------------------------------
### RiskAssessments Settings NewDevice GetAsync
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Gets the risk assessment settings for the new device assessor.
```APIDOC
## RiskAssessments Settings NewDevice GetAsync
### Description
Gets the risk assessment settings for the new device assessor.
### Method
GET
### Endpoint
/api/v2/risk-assessment/settings/new-device
### Response
#### Success Response (200)
- **content** (object) - The risk assessment settings for the new device assessor.
```
--------------------------------
### Auth0 Management API Client Initialization (v7)
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Illustrates manual token management required for initializing the ManagementApiClient in v7.
```csharp
using Auth0.ManagementApi;
// Required manual token management
var token = await GetAccessTokenAsync(); // Your token acquisition logic
var client = new ManagementApiClient(token, new Uri("https://YOUR_DOMAIN/api/v2"));
```
--------------------------------
### Auth0 Management Client Initialization (v8 - Delegate Token Provider)
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Illustrates using a DelegateTokenProvider for custom token retrieval in v8, such as from a secret manager.
```csharp
using Auth0.ManagementApi;
// Or retrieve tokens asynchronously (e.g., from a secret manager) via ManagementClient
var client = new ManagementClient(new ManagementClientOptions
{
Domain = "YOUR_DOMAIN",
TokenProvider = new DelegateTokenProvider(ct => secretManager.GetSecretAsync("auth0-token", ct))
});
```
--------------------------------
### Get Flows Vault Connection by ID
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves a specific Flows Vault Connection by its ID.
```csharp
await client.Flows.Vault.Connections.GetAsync("id");
```
--------------------------------
### Initialize ManagementApiClient with an Existing Token
Source: https://github.com/auth0/auth0.net/blob/master/README.md
Use this client if you manage token acquisition and refreshing yourself. Ensure the token has the necessary permissions.
```csharp
var client = new ManagementApiClient(
token: "your-access-token",
clientOptions: new ClientOptions { BaseUrl = "https://YOUR_AUTH0_DOMAIN/api/v2" });
```
--------------------------------
### Get Network ACL
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves a specific access control list entry for your client by its ID.
```APIDOC
## Get Network ACL
### Description
Get a specific access control list entry for your client.
### Method
GET
### Endpoint
/api/v2/network-rules/{id}
### Parameters
#### Path Parameters
- **id** (string) - Required - The ID of the access control list to retrieve.
### Response
#### Success Response (200)
- **id** (string) - The ID of the ACL entry.
- **Description** (string) - The description of the ACL entry.
- **Active** (boolean) - Whether the ACL entry is active.
- **Rule** (object) - The rule configuration for the ACL entry.
- **Action** (object) - The action taken.
- **Scope** (string) - The scope of the rule.
```
--------------------------------
### Get User Groups
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves a list of all groups to which a specific user belongs. Supports filtering and pagination.
```APIDOC
## Get User Groups
### Description
List all groups to which this user belongs.
### Method
`client.Users.Groups.GetAsync(id, GetUserGroupsRequestParameters { ... })`
### Parameters
#### Path Parameters
- **id** (string) - Required - ID of the user to list groups for.
#### Request Body
- **request** (GetUserGroupsRequestParameters) - Required - Parameters for fetching user groups.
- **Fields** (string) - Optional - Specifies which fields to include in the response.
- **IncludeFields** (bool) - Optional - Whether to include the specified fields.
- **From** (string) - Optional - Used for pagination, specifies the starting point.
- **Take** (int) - Optional - Used for pagination, specifies the number of items to return.
### Request Example
```csharp
await client.Users.Groups.GetAsync(
"id",
new GetUserGroupsRequestParameters
{
Fields = "fields",
IncludeFields = true,
From = "from",
Take = 1,
}
);
```
### Response
#### Success Response (Pager)
- Returns a paginated list of user groups.
```
--------------------------------
### Initialize ManagementClient with Static Token
Source: https://github.com/auth0/auth0.net/blob/master/docs-source/index.md
Initialize the ManagementClient using a pre-obtained static access token.
```csharp
// With a static token
var client = new ManagementClient(new ManagementClientOptions
{
Domain = "YOUR_AUTH0_DOMAIN",
Token = "your-access-token"
});
```
--------------------------------
### Get Directory Provisioning Configuration
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieve a specific directory provisioning configuration for a given connection ID.
```csharp
await client.Connections.DirectoryProvisioning.GetAsync("id");
```
--------------------------------
### Retrieve CAPTCHA Configuration
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Gets the CAPTCHA configuration for your client. Use this to view current CAPTCHA settings.
```csharp
await client.AttackProtection.Captcha.GetAsync();
```
--------------------------------
### client.Keys.Signing.ListAsync()
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieve details of all the application signing keys associated with your tenant.
```APIDOC
## ListAsync
### Description
Retrieve details of all the application signing keys associated with your tenant.
### Method
GET
### Endpoint
/keys/signing
### Parameters
#### Query Parameters
None
### Response
#### Success Response (200)
- **signingKeys** (IEnumerable) - A list of signing keys.
### Request Example
```csharp
await client.Keys.Signing.ListAsync();
```
```
--------------------------------
### List Prompt Rendering Settings
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves render setting configurations for all screens. Supports filtering and pagination.
```csharp
await client.Prompts.Rendering.ListAsync(
new ListAculsRequestParameters
{
Fields = "fields",
IncludeFields = true,
Page = 1,
PerPage = 1,
IncludeTotals = true,
Prompt = "prompt",
Screen = "screen",
RenderingMode = AculRenderingModeEnum.Advanced,
}
);
```
--------------------------------
### Get Specific Action Version
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves a specific version of an action. Action versions are immutable once created.
```csharp
await client.Actions.Versions.GetAsync("actionId", "id");
```
--------------------------------
### Organize User Operations with Sub-clients (v7 vs v8)
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
v8 introduces hierarchical sub-clients for better organization of related resources, such as user permissions, roles, logs, and organizations. This contrasts with v7's flat client structure.
```csharp
var permissions = await client.Users.GetPermissionsAsync("user_id");
var roles = await client.Users.GetRolesAsync("user_id");
var logs = await client.Users.GetLogsAsync("user_id");
var organizations = await client.Users.GetAllOrganizationsAsync("user_id");
```
```csharp
var permissions = await client.Users.Permissions.ListAsync("user_id", new ListUserPermissionsRequestParameters());
var roles = await client.Users.Roles.ListAsync("user_id", new ListUserRolesRequestParameters());
var logs = await client.Users.Logs.ListAsync("user_id", new ListUserLogsRequestParameters());
var organizations = await client.Users.Organizations.ListAsync("user_id", new ListUserOrganizationsRequestParameters());
```
--------------------------------
### Get User Attribute Profile
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves the details of a single User Attribute Profile, identified by its ID.
```csharp
await client.UserAttributeProfiles.GetAsync("id");
```
--------------------------------
### User Management: Listing Users (v8)
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Shows how to list users in v8 using `ListUsersRequestParameters` and the `client.Users.ListAsync` method, including pagination and total count retrieval.
```APIDOC
## GET /api/v2/users
### Description
Retrieves a list of users, with support for filtering, pagination, and sorting.
### Method
GET
### Endpoint
/api/v2/users
### Parameters
#### Query Parameters
- **SearchEngine** (SearchEngineVersionsEnum) - Optional - Specifies the search engine version to use (e.g., V3).
- **Q** (string) - Optional - The query to search for users.
- **PerPage** (int) - Optional - The number of users to return per page.
- **IncludeTotals** (boolean) - Optional - Whether to include the total count of users in the response.
### Request Example
```csharp
var request = new ListUsersRequestParameters
{
SearchEngine = SearchEngineVersionsEnum.V3,
Q = "email:*@example.com",
PerPage = 50,
IncludeTotals = true
};
var pager = await client.Users.ListAsync(request);
```
### Response
#### Success Response (200)
- **Items** (array) - A list of user objects.
- **Total** (int) - The total number of users matching the query (if `IncludeTotals` is true).
#### Response Example
```csharp
// Access total count
var firstPageResponse = (ListUsersOffsetPaginatedResponseContent?)pager.CurrentPage.Response;
var totalUsers = firstPageResponse?.Total;
// Iterate through all users
await foreach (var user in pager)
{
Console.WriteLine(user.Email);
}
```
```
--------------------------------
### Get User Attribute Profile Template
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves a specific User Attribute Profile Template by its ID.
```csharp
await client.UserAttributeProfiles.GetTemplateAsync("id");
```
--------------------------------
### Splunk Log Stream Response Payload
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Example response payload after creating a Splunk log stream.
```json
{
"id": "string",
"name": "string",
"type": "splunk",
"status": "active",
"sink": {
"splunkDomain": "string",
"splunkToken": "string",
"splunkPort": "string",
"splunkSecure": "boolean"
}
}
```
--------------------------------
### Datadog Log Stream Response Payload
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Example response payload after creating a Datadog log stream.
```json
{
"id": "string",
"name": "string",
"type": "datadog",
"status": "active",
"sink": {
"datadogRegion": "string",
"datadogApiKey": "string"
}
}
```
--------------------------------
### Create a New Organization
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Creates a new organization in your tenant. Review Auth0 documentation for detailed configuration options.
```csharp
await client.Organizations.CreateAsync(new CreateOrganizationRequestContent { Name = "name" });
```
--------------------------------
### HTTP Log Stream Response Payload
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Example response payload after creating an HTTP log stream.
```json
{
"id": "string",
"name": "string",
"type": "http",
"status": "active",
"sink": {
"httpEndpoint": "string",
"httpContentType": "string",
"httpContentFormat": "JSONLINES|JSONARRAY",
"httpAuthorization": "string"
}
}
```
--------------------------------
### Release Auth0.NET Package
Source: https://github.com/auth0/auth0.net/blob/master/DEVELOPMENT.md
Build a release version of the Auth0.NET library. This process requires Windows and involves npm commands for versioning, pushing to a release branch, and uploading to NuGet.
```bash
npm run release 7.3.0
```
```bash
nuget push
```
--------------------------------
### Create HTTP Log Stream using C# SDK
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Example of creating an HTTP log stream using the Auth0 .NET SDK. Ensure the LogStreamsClient is initialized.
```csharp
await client.LogStreams.CreateAsync(
new CreateLogStreamHttpRequestBody
{
Type = LogStreamHttpEnum.Http,
Sink = new LogStreamHttpSink { HttpEndpoint = "httpEndpoint" },
}
);
```
--------------------------------
### Get User Groups
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves a list of all groups a specific user belongs to. Supports filtering and pagination parameters.
```csharp
await client.Users.Groups.GetAsync(
"id",
new GetUserGroupsRequestParameters
{
Fields = "fields",
IncludeFields = true,
From = "from",
Take = 1,
}
);
```
--------------------------------
### Get Risk Assessments Settings in C#
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves the current tenant settings for risk assessments. No parameters are required.
```csharp
await client.RiskAssessments.Settings.GetAsync();
```
--------------------------------
### Initialize ManagementClient with Client Credentials
Source: https://github.com/auth0/auth0.net/blob/master/README.md
Recommended for server-to-server applications. This client automatically acquires and refreshes tokens using client credentials.
```csharp
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();
```
--------------------------------
### User Creation API Call (v7 vs v8)
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Shows the difference in creating a user between v7 (UserCreateRequest) and v8 (CreateUserRequestContent).
```csharp
// Old (v7)
var request = new UserCreateRequest
{
Email = "test@example.com",
Connection = "Username-Password-Authentication"
};
User created = await client.Users.CreateAsync(request);
// New (v8)
var request = new CreateUserRequestContent
{
Email = "test@example.com",
Connection = "Username-Password-Authentication"
};
CreateUserResponseContent created = await client.Users.CreateAsync(request);
```
--------------------------------
### Get Organization Invitation by ID with Auth0.NET
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieve a specific organization invitation by its ID. Supports field filtering.
```csharp
await client.Organizations.Invitations.GetAsync(
"id",
"invitation_id",
new GetOrganizationInvitationRequestParameters { Fields = "fields", IncludeFields = true }
);
```
--------------------------------
### Get Organization Connection
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves details of a specific connection associated with an organization. Requires both organization and connection identifiers.
```csharp
await client.Organizations.Connections.GetAsync("id", "connection_id");
```
--------------------------------
### Create Resource Server
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Create a new API associated with your tenant. All new APIs must be registered with Auth0.
```csharp
await client.ResourceServers.CreateAsync(
new CreateResourceServerRequestContent { Identifier = "identifier" }
);
```
--------------------------------
### Auth0 Authentication API Usage (v7 & v8)
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
The Auth0.AuthenticationApi package is unchanged between v7 and v8. This example shows how to obtain a token using Resource Owner Password credentials.
```csharp
using Auth0.AuthenticationApi;
var client = new AuthenticationApiClient(new Uri("https://YOUR_DOMAIN"));
var tokenRequest = new ResourceOwnerTokenRequest
{
ClientId = "YOUR_CLIENT_ID",
ClientSecret = "YOUR_CLIENT_SECRET",
Username = "user@example.com",
Password = "password",
Scope = "openid profile"
};
var token = await client.GetTokenAsync(tokenRequest);
```
--------------------------------
### Retrieve DUO Factor Settings
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves the DUO account and factor configuration. Use this to get the current settings.
```csharp
await client.Guardian.Factors.Duo.Settings.GetAsync();
```
--------------------------------
### Get Group Members
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
List all users that are a member of a specific group. This method supports pagination and field selection.
```csharp
await client.Groups.Members.GetAsync(
"id",
new GetGroupMembersRequestParameters
{
Fields = "fields",
IncludeFields = true,
From = "from",
Take = 1,
}
);
```
--------------------------------
### v8 User Creation Request and Response
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Illustrates the v8 approach to creating a user, using 'RequestContent' for requests and 'ResponseContent' for responses. The response type is now more specific.
```csharp
// Request type named *RequestContent, response is *ResponseContent
var request = new CreateUserRequestContent
{
Email = "user@example.com",
Connection = "Username-Password-Authentication",
Password = "SecurePassword123!"
};
CreateUserResponseContent createdUser = await client.Users.CreateAsync(request);
// createdUser is of type CreateUserResponseContent
```
--------------------------------
### CreateAsync
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Create a new custom domain.
```APIDOC
## CreateAsync
### Description
Create a new custom domain. The custom domain will need to be verified before it will accept requests. Optional attributes that can be updated include `custom_client_ip_header` and `tls_policy`. TLS Policies include `recommended` (for modern usage this includes TLS 1.2 only).
### Method
`client.CustomDomains.CreateAsync`
### Parameters
#### Request Body
- **request**: `CreateCustomDomainRequestContent` - Required - Content for creating a custom domain.
- **Domain** (string) - Required - The domain name.
- **Type** (CustomDomainProvisioningTypeEnum) - Required - The provisioning type of the custom domain.
### Request Example
```csharp
await client.CustomDomains.CreateAsync(
new CreateCustomDomainRequestContent
{
Domain = "domain",
Type = CustomDomainProvisioningTypeEnum.Auth0ManagedCerts,
}
);
```
### Response
#### Success Response (200)
- **CreateCustomDomainResponseContent** - The created custom domain.
```
--------------------------------
### List Prompt Rendering Settings
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves render setting configurations for all screens. This endpoint is useful for understanding the current rendering behavior of prompts across different screens.
```APIDOC
## Prompts Rendering ListAsync
### Description
Get render setting configurations for all screens.
### Method
GET
### Endpoint
/api/v2/prompts/rendering
### Parameters
#### Query Parameters
- **fields** (string) - Optional - Specifies which fields to include in the response.
- **include_fields** (boolean) - Optional - Determines whether to include specified fields.
- **page** (integer) - Optional - The page number for pagination.
- **per_page** (integer) - Optional - The number of items per page for pagination.
- **include_totals** (boolean) - Optional - Indicates whether to include total counts in the response.
- **prompt** (string) - Optional - Filters results by prompt name.
- **screen** (string) - Optional - Filters results by screen name.
- **rendering_mode** (AculRenderingModeEnum) - Optional - Filters results by rendering mode.
### Request Example
```csharp
await client.Prompts.Rendering.ListAsync(
new ListAculsRequestParameters
{
Fields = "fields",
IncludeFields = true,
Page = 1,
PerPage = 1,
IncludeTotals = true,
Prompt = "prompt",
Screen = "screen",
RenderingMode = AculRenderingModeEnum.Advanced,
}
);
```
### Response
#### Success Response (200)
- **content** (Pager) - A paginated list of rendering configurations.
```
--------------------------------
### Get Client Credential
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves the details of a specific client credential using its ID and the client's ID.
```APIDOC
## GetAsync Clients Credentials
### Description
Retrieves the details of a specific client credential.
### Method
`client.Clients.Credentials.GetAsync`
### Parameters
#### Path Parameters
- **clientId** (string) - Required - ID of the client.
- **credentialId** (string) - Required - ID of the credential to retrieve.
### Response
#### Success Response (WithRawResponseTask)
- Returns a task that resolves to a response containing the requested ClientCredential object.
```
--------------------------------
### Retrieve Default Branding Theme
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Use this method to get the default branding theme settings for your Auth0 tenant.
```csharp
await client.Branding.Themes.GetDefaultAsync();
```
--------------------------------
### CreateAsync
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Create a Connection Profile.
```APIDOC
## CreateAsync Connection Profile
### Description
Create a Connection Profile.
### Method
POST
### Endpoint
/api/v2/connection-profiles
### Parameters
#### Request Body
- **name** (string) - Required - The name of the connection profile.
- **assign_membership_on_login** (boolean) - Optional - Whether to assign membership on login.
- **assign_ticket_on_login** (boolean) - Optional - Whether to assign ticket on login.
- **metadata** (object) - Optional - Custom metadata for the connection profile.
### Request Example
```json
{
"name": "NewConnectionProfile",
"assign_membership_on_login": true,
"metadata": {
"custom_key": "custom_value"
}
}
```
### Response
#### Success Response (201)
- **id** (string) - The unique identifier for the created connection profile.
- **name** (string) - The name of the connection profile.
- **assign_membership_on_login** (boolean) - Whether to assign membership on login.
- **assign_ticket_on_login** (boolean) - Whether to assign ticket on login.
- **metadata** (object) - Custom metadata for the connection profile.
- **created_at** (string) - The timestamp when the connection profile was created.
- **updated_at** (string) - The timestamp when the connection profile was last updated.
#### Response Example
```json
{
"id": "cp_456",
"name": "NewConnectionProfile",
"assign_membership_on_login": true,
"assign_ticket_on_login": false,
"metadata": {
"custom_key": "custom_value"
},
"created_at": "2023-01-02T10:00:00Z",
"updated_at": "2023-01-02T10:00:00Z"
}
```
```
--------------------------------
### Get Network ACL by ID
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves a specific access control list entry for your client using its ID.
```csharp
await client.NetworkAcls.GetAsync("id");
```
--------------------------------
### Initialize Management Client with Manual Token Management
Source: https://github.com/auth0/auth0.net/blob/master/Examples.md
Initialize the Management API client by manually fetching and providing the access token. This approach requires explicit token acquisition and refresh logic.
```csharp
using Auth0.ManagementApi;
public async Task InitializeWithManualToken()
{
var authClient = new AuthenticationApiClient("my.custom.domain");
// Fetch the access token using the Client Credentials.
var accessTokenResponse = await authClient.GetTokenAsync(new ClientCredentialsTokenRequest()
{
Audience = "https://my.custom.domain/api/v2/",
ClientId = "clientId",
ClientSecret = "clientSecret",
});
var apiClient = new ManagementApiClient(
token: accessTokenResponse.AccessToken,
clientOptions: new ClientOptions { BaseUrl = "https://my.custom.domain/api/v2" });
}
```
--------------------------------
### Get Custom Domain by ID
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves a specific custom domain's configuration and status using its ID.
```csharp
await client.CustomDomains.GetAsync("id");
```
--------------------------------
### Apply Code Formatting
Source: https://github.com/auth0/auth0.net/blob/master/CONTRIBUTING.md
Automatically format the code to comply with the project's established style guidelines.
```bash
dotnet format
```
--------------------------------
### CreateAsync
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Create a new API associated with your tenant. New APIs must be registered with Auth0.
```APIDOC
## CreateAsync Resource Server
### Description
Create a new API associated with your tenant. Note that all new APIs must be registered with Auth0.
### Method
`client.ResourceServers.CreateAsync`
### Parameters
#### Request Body
- **request**: `CreateResourceServerRequestContent` - The content for creating the new resource server.
- **Identifier** (string) - Required - The unique identifier for the new API.
### Request Example
```csharp
await client.ResourceServers.CreateAsync(
new CreateResourceServerRequestContent { Identifier = "identifier" }
);
```
### Response
#### Success Response
- `WithRawResponseTask` - The created resource server details.
```
--------------------------------
### Retrieve Branding Settings
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Use this snippet to get the current branding settings for your Auth0 tenant. No parameters are required.
```csharp
await client.Branding.GetAsync();
```
--------------------------------
### ListAsync
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieve a list of directory provisioning configurations of a tenant. Supports filtering by 'From' and 'Take' parameters.
```APIDOC
## ListAsync
### Description
Retrieve a list of directory provisioning configurations of a tenant.
### Method
GET
### Endpoint
/api/v2/connections/{id}/provisioning-connections
### Parameters
#### Query Parameters
- **from** (string) - Optional - The cursor to start retrieving results from.
- **take** (integer) - Optional - The maximum number of results to return.
### Request Example
```json
{
"from": "cursor_value",
"take": 10
}
```
### Response
#### Success Response (200)
- **directory_provisioning** (array) - A list of directory provisioning configurations.
- **id** (string) - The ID of the provisioning configuration.
- **name** (string) - The name of the provisioning configuration.
- **type** (string) - The type of the provisioning configuration.
- **created_at** (string) - The timestamp when the configuration was created.
- **updated_at** (string) - The timestamp when the configuration was last updated.
### Response Example
```json
{
"directory_provisioning": [
{
"id": "prov_123",
"name": "MyProvisioningConfig",
"type": "SAML",
"created_at": "2023-01-01T12:00:00Z",
"updated_at": "2023-01-01T12:00:00Z"
}
]
}
```
```
--------------------------------
### Get Default Directory Provisioning Attribute Mapping
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieve the default attribute mapping for directory provisioning of a specific connection.
```csharp
await client.Connections.DirectoryProvisioning.GetDefaultMappingAsync("id");
```
--------------------------------
### CreateAsync
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Create a phone provider. The `credentials` object requires different properties depending on the phone provider (which is specified using the `name` property).
```APIDOC
## CreateAsync
### Description
Create a phone provider. The `credentials` object requires different properties depending on the phone provider (which is specified using the `name` property).
### Method
POST
### Endpoint
/api/v2/branding/phone-providers
### Parameters
#### Request Body
- **name** (string) - Required - The name of the phone provider (e.g., "twilio").
- **credentials** (object) - Required - The credentials for the phone provider. Properties vary based on the provider.
- **enabled** (boolean) - Optional - Whether the phone provider is enabled.
### Request Example
```json
{
"name": "twilio",
"credentials": {
"auth_token": "your_auth_token"
},
"enabled": true
}
```
### Response
#### Success Response (201)
- **name** (string) - The name of the phone provider.
- **credentials** (object) - The credentials for the phone provider.
- **enabled** (boolean) - Whether the phone provider is enabled.
### Response Example
```json
{
"name": "twilio",
"credentials": {
"auth_token": "your_auth_token"
},
"enabled": true
}
```
```
--------------------------------
### Get Branding Phone Provider
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieves details for a specific phone provider by its ID. Fields to include or exclude can be specified.
```csharp
await client.Branding.Phone.Providers.GetAsync("id");
```
--------------------------------
### Create User: v7 vs v8
Source: https://github.com/auth0/auth0.net/blob/master/V8_MIGRATION_GUIDE.md
Compares the C# code for creating a user in Auth0 .NET SDK v7 and v8. Note the change in request object naming.
```csharp
var userRequest = new UserCreateRequest
{
Email = "newuser@example.com",
Connection = "Username-Password-Authentication",
Password = "SecureP@ssw0rd!",
EmailVerified = true
};
var user = await client.Users.CreateAsync(userRequest);
Console.WriteLine($"Created user: {user.UserId}");
```
```csharp
var request = new CreateUserRequestContent
{
Email = "newuser@example.com",
Connection = "Username-Password-Authentication",
Password = "SecureP@ssw0rd!",
EmailVerified = true
};
var user = await client.Users.CreateAsync(request);
Console.WriteLine($"Created user: {user.UserId}");
```
--------------------------------
### Get Action Version
Source: https://github.com/auth0/auth0.net/blob/master/reference.md
Retrieve a specific version of an action. An action version is created whenever an action is deployed and is immutable.
```APIDOC
## Get Action Version
### Description
Retrieve a specific version of an action. An action version is created whenever an action is deployed. An action version is immutable, once created.
### Method
GET
### Endpoint
/api/v2/actions/{actionId}/versions/{id}
### Parameters
#### Path Parameters
- **actionId** (string) - Required - The ID of the action.
- **id** (string) - Required - The ID of the action version.
### Request Example
```json
{
"actionId": "string",
"id": "string"
}
```
### Response
#### Success Response (200)
- **version** (object) - The requested action version.
#### Response Example
```json
{
"example": "response body"
}
```
```