Class GuardianClient
- Namespace
- Auth0.ManagementApi.Clients
- Assembly
- Auth0.ManagementApi.dll
Contains methods to access the /guardian endpoints.
public class GuardianClient : BaseClient, IGuardianClient
- Inheritance
-
GuardianClient
- Implements
- Inherited Members
Constructors
GuardianClient(IManagementConnection, Uri, IDictionary<string, string>)
Initializes a new instance of GuardianClient.
public GuardianClient(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
CreateEnrollmentTicketAsync(CreateGuardianEnrollmentTicketRequest, CancellationToken)
Generate an email with a link to start the Guardian enrollment process.
public Task<CreateGuardianEnrollmentTicketResponse> CreateEnrollmentTicketAsync(CreateGuardianEnrollmentTicketRequest request, CancellationToken cancellationToken = default)
Parameters
request
CreateGuardianEnrollmentTicketRequestThe CreateGuardianEnrollmentTicketRequest containing the information about the user who should be enrolled.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<CreateGuardianEnrollmentTicketResponse>
A CreateGuardianEnrollmentTicketResponse with the details of the ticket that was created.
DeleteEnrollmentAsync(string, CancellationToken)
Deletes an enrollment.
public Task DeleteEnrollmentAsync(string id, CancellationToken cancellationToken = default)
Parameters
id
stringThe ID of the enrollment to delete.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
GetEnrollmentAsync(string, CancellationToken)
Retrieves an enrollment.
public Task<GuardianEnrollment> GetEnrollmentAsync(string id, CancellationToken cancellationToken = default)
Parameters
id
stringThe ID of the enrollment to retrieve.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<GuardianEnrollment>
A GuardianEnrollment containing details of the enrollment.
GetFactorsAsync(CancellationToken)
Retrieves all factors. Useful to check factor enablement and trial status.
public Task<IList<GuardianFactor>> GetFactorsAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationToken
Returns
- Task<IList<GuardianFactor>>
List of GuardianFactor instances with the available factors.
GetPhoneMessageTypesAsync(CancellationToken)
Retrieve the enabled phone factors for multi-factor authentication
public Task<GuardianPhoneMessageTypes> GetPhoneMessageTypesAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<GuardianPhoneMessageTypes>
A GuardianPhoneMessageTypes containing the message types.
GetSmsTemplatesAsync(CancellationToken)
Retrieves enrollment and verification templates. You can use it to check the current values for your templates.
public Task<GuardianSmsEnrollmentTemplates> GetSmsTemplatesAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationToken
Returns
- Task<GuardianSmsEnrollmentTemplates>
A GuardianSmsEnrollmentTemplates containing the templates.
GetSnsConfigurationAsync(CancellationToken)
Returns provider configuration for AWS SNS.
public Task<GuardianSnsConfiguration> GetSnsConfigurationAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationToken
Returns
- Task<GuardianSnsConfiguration>
A GuardianSnsConfiguration containing Amazon SNS configuration.
GetTwilioConfigurationAsync(CancellationToken)
Returns configuration for the Guardian Twilio provider.
public Task<GuardianTwilioConfiguration> GetTwilioConfigurationAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationToken
Returns
- Task<GuardianTwilioConfiguration>
GuardianTwilioConfiguration with the Twilio configuration.
UpdateFactorAsync(UpdateGuardianFactorRequest, CancellationToken)
Enable or Disable a Guardian factor.
public Task<UpdateGuardianFactorResponse> UpdateFactorAsync(UpdateGuardianFactorRequest request, CancellationToken cancellationToken = default)
Parameters
request
UpdateGuardianFactorRequestThe UpdateGuardianFactorRequest containing the details of the factor to update.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<UpdateGuardianFactorResponse>
The UpdateGuardianFactorResponse indicating the status of the factor.
UpdatePhoneMessageTypesAsync(GuardianPhoneMessageTypes, CancellationToken)
Update enabled phone factors for multi-factor authentication
public Task<GuardianPhoneMessageTypes> UpdatePhoneMessageTypesAsync(GuardianPhoneMessageTypes messageTypes, CancellationToken cancellationToken = default)
Parameters
messageTypes
GuardianPhoneMessageTypesA GuardianPhoneMessageTypes containing the list of phone factors to enable on the tenan.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<GuardianPhoneMessageTypes>
A GuardianPhoneMessageTypes containing the message types.
UpdateSmsTemplatesAsync(GuardianSmsEnrollmentTemplates, CancellationToken)
Updates enrollment and verification templates. Useful to send custom messages on SMS enrollment and verification.
public Task<GuardianSmsEnrollmentTemplates> UpdateSmsTemplatesAsync(GuardianSmsEnrollmentTemplates templates, CancellationToken cancellationToken = default)
Parameters
templates
GuardianSmsEnrollmentTemplatesA GuardianSmsEnrollmentTemplates containing the updated templates.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<GuardianSmsEnrollmentTemplates>
A GuardianSmsEnrollmentTemplates containing the templates.
UpdateTwilioConfigurationAsync(UpdateGuardianTwilioConfigurationRequest, CancellationToken)
Configure the Guardian Twilio provider.
public Task<GuardianTwilioConfiguration> UpdateTwilioConfigurationAsync(UpdateGuardianTwilioConfigurationRequest request, CancellationToken cancellationToken = default)
Parameters
request
UpdateGuardianTwilioConfigurationRequestThe UpdateGuardianTwilioConfigurationRequest containing the configuration settings.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<GuardianTwilioConfiguration>
The GuardianTwilioConfiguration containing the updated configuration settings.