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
connectionIManagementConnectionIManagementConnection used to make all API calls.
baseUriUriUri of the endpoint to use in making API calls.
defaultHeadersIDictionary<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
requestClientCreateRequestThe ClientCreateRequest containing the properties of the new client.
cancellationTokenCancellationTokenThe 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
clientIdstringThe id of the client for which you want to create the credential.
requestClientCredentialCreateRequestThe ClientCredentialCreateRequest containing the properties of the new client credential.
cancellationTokenCancellationTokenThe 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
idstringThe id of the client to delete.
cancellationTokenCancellationTokenThe 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
clientIdstringThe id of the client for which you want to remove the credential.
credentialIdstringThe id of the credential to remove.
cancellationTokenCancellationTokenThe 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
requestGetClientsRequestSpecifies criteria to use when querying clients.
paginationPaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationTokenCancellationTokenThe 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
clientIdstringThe id of the client for which you want to retrieve the credentials.
cancellationTokenCancellationTokenThe 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
idstringThe id of the client to retrieve.
fieldsstringA comma separated list of fields to include or exclude (depending on includeFields) from the result, empty to retrieve all fields.
includeFieldsbooltrue if the fields specified are to be included in the result, false otherwise (defaults to true)
cancellationTokenCancellationTokenThe 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
clientIdstringThe id of the client for which you want to retrieve the credential.
credentialIdstringThe id of the credential to retrieve.
cancellationTokenCancellationTokenThe 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
idstringThe id of the client which secret needs to be rotated.
cancellationTokenCancellationTokenThe 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
idstringThe id of the client you want to update.
requestClientUpdateRequestThe ClientUpdateRequest containing the properties of the client you want to update.
cancellationTokenCancellationTokenThe 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
clientIdstringThe id of the client for which you want to update the credential.
credentialIdstringThe id of the credential to update.
requestClientCredentialUpdateRequestThe ClientCredentialUpdateRequest containing the properties of the new client credential.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
- Task<Credential>
The new Credential that has been created.