Class ClientsClient
- Namespace
- Auth0.ManagementApi.Clients
- Assembly
- Auth0.ManagementApi.dll
Contains methods to access the /clients endpoints.
public class ClientsClient : BaseClient, IClientsClient
- Inheritance
-
ClientsClient
- Implements
- Inherited Members
Constructors
ClientsClient(IManagementConnection, Uri, IDictionary<string, string>)
Initializes a new instance of ClientsClient.
public ClientsClient(IManagementConnection connection, Uri baseUri, IDictionary<string, string> defaultHeaders)
Parameters
connection
IManagementConnectionIManagementConnection used to make all API calls.
baseUri
UriUri of the endpoint to use in making API calls.
defaultHeaders
IDictionary<string, string>Dictionary containing default headers included with every request this client makes.
Methods
CreateAsync(ClientCreateRequest, CancellationToken)
Creates a new client application.
public Task<Client> CreateAsync(ClientCreateRequest request, CancellationToken cancellationToken = default)
Parameters
request
ClientCreateRequestThe ClientCreateRequest containing the properties of the new client.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
CreateCredentialAsync(string, ClientCredentialCreateRequest, CancellationToken)
Creates a new client credential.
public Task<Credential> CreateCredentialAsync(string clientId, ClientCredentialCreateRequest request, CancellationToken cancellationToken = default)
Parameters
clientId
stringThe id of the client for which you want to create the credential.
request
ClientCredentialCreateRequestThe ClientCredentialCreateRequest containing the properties of the new client credential.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<Credential>
The new Credential that has been created.
DeleteAsync(string, CancellationToken)
Deletes a client and all its related assets (like rules, connections, etc) given its id.
public Task DeleteAsync(string id, CancellationToken cancellationToken = default)
Parameters
id
stringThe id of the client to delete.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
DeleteCredentialAsync(string, string, CancellationToken)
Deletes a specific credential registered with the provided client.
public Task DeleteCredentialAsync(string clientId, string credentialId, CancellationToken cancellationToken = default)
Parameters
clientId
stringThe id of the client for which you want to remove the credential.
credentialId
stringThe id of the credential to remove.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
GetAllAsync(GetClientsRequest, PaginationInfo, CancellationToken)
Retrieves a list of all client applications.
public Task<IPagedList<Client>> GetAllAsync(GetClientsRequest request, PaginationInfo pagination = null, CancellationToken cancellationToken = default)
Parameters
request
GetClientsRequestSpecifies criteria to use when querying clients.
pagination
PaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<Client>>
An IPagedList<T> containing the clients.
GetAllCredentialsAsync(string, CancellationToken)
Retrieves a list of all credentials for a client.
public Task<IList<Credential>> GetAllCredentialsAsync(string clientId, CancellationToken cancellationToken = default)
Parameters
clientId
stringThe id of the client for which you want to retrieve the credentials.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IList<Credential>>
An IList<T> containing the client's credentials.
GetAsync(string, string, bool, CancellationToken)
Retrieves a client by its id.
public Task<Client> GetAsync(string id, string fields = null, bool includeFields = true, CancellationToken cancellationToken = default)
Parameters
id
stringThe id of the client to retrieve.
fields
stringA comma separated list of fields to include or exclude (depending on includeFields) from the result, empty to retrieve all fields.
includeFields
booltrue if the fields specified are to be included in the result, false otherwise (defaults to true)
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
GetCredentialAsync(string, string, CancellationToken)
Retrieves a specific credential for a client.
public Task<Credential> GetCredentialAsync(string clientId, string credentialId, CancellationToken cancellationToken = default)
Parameters
clientId
stringThe id of the client for which you want to retrieve the credential.
credentialId
stringThe id of the credential to retrieve.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<Credential>
A Credential containing the client's credential.
RotateClientSecret(string, CancellationToken)
Rotate a client secret. The generated secret is NOT base64 encoded.
public Task<Client> RotateClientSecret(string id, CancellationToken cancellationToken = default)
Parameters
id
stringThe id of the client which secret needs to be rotated.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
UpdateAsync(string, ClientUpdateRequest, CancellationToken)
Updates a client application.
public Task<Client> UpdateAsync(string id, ClientUpdateRequest request, CancellationToken cancellationToken = default)
Parameters
id
stringThe id of the client you want to update.
request
ClientUpdateRequestThe ClientUpdateRequest containing the properties of the client you want to update.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
UpdateCredentialAsync(string, string, ClientCredentialUpdateRequest, CancellationToken)
Update a client credential.
public Task<Credential> UpdateCredentialAsync(string clientId, string credentialId, ClientCredentialUpdateRequest request, CancellationToken cancellationToken = default)
Parameters
clientId
stringThe id of the client for which you want to update the credential.
credentialId
stringThe id of the credential to update.
request
ClientCredentialUpdateRequestThe ClientCredentialUpdateRequest containing the properties of the new client credential.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<Credential>
The new Credential that has been created.