コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ManagementApiClient"/> class.
        /// </summary>
        /// <param name="token">A valid Auth0 Management API v2 token.</param>
        /// <param name="baseUri"><see cref="Uri"/> of the tenant to manage.</param>
        /// <param name="managementConnection"><see cref="IManagementConnection"/> to facilitate communication with server.</param>
        public ManagementApiClient(string token, Uri baseUri, IManagementConnection managementConnection = null)
        {
            if (managementConnection == null)
            {
                var ownedManagementConnection = new HttpClientManagementConnection();
                managementConnection = ownedManagementConnection;
                connectionToDispose  = ownedManagementConnection;
            }

            var defaultHeaders = CreateDefaultHeaders(token);

            BlacklistedTokens = new BlacklistedTokensClient(managementConnection, baseUri, defaultHeaders);
            ClientGrants      = new ClientGrantsClient(managementConnection, baseUri, defaultHeaders);
            Clients           = new ClientsClient(managementConnection, baseUri, defaultHeaders);
            Connections       = new ConnectionsClient(managementConnection, baseUri, defaultHeaders);
            CustomDomains     = new CustomDomainsClient(managementConnection, baseUri, defaultHeaders);
            DeviceCredentials = new DeviceCredentialsClient(managementConnection, baseUri, defaultHeaders);
            EmailProvider     = new EmailProviderClient(managementConnection, baseUri, defaultHeaders);
            EmailTemplates    = new EmailTemplatesClient(managementConnection, baseUri, defaultHeaders);
            Guardian          = new GuardianClient(managementConnection, baseUri, defaultHeaders);
            Jobs            = new JobsClient(managementConnection, baseUri, defaultHeaders);
            Logs            = new LogsClient(managementConnection, baseUri, defaultHeaders);
            ResourceServers = new ResourceServersClient(managementConnection, baseUri, defaultHeaders);
            Roles           = new RolesClient(managementConnection, baseUri, defaultHeaders);
            Rules           = new RulesClient(managementConnection, baseUri, defaultHeaders);
            Stats           = new StatsClient(managementConnection, baseUri, defaultHeaders);
            TenantSettings  = new TenantSettingsClient(managementConnection, baseUri, defaultHeaders);
            Tickets         = new TicketsClient(managementConnection, baseUri, defaultHeaders);
            UserBlocks      = new UserBlocksClient(managementConnection, baseUri, defaultHeaders);
            Users           = new UsersClient(managementConnection, baseUri, defaultHeaders);
        }
コード例 #2
0
 public RateLimitAwareManagementConnection(IManagementConnection wrapped, IReporter reporter, double retrySeconds = 1)
 {
     _wrapped     = wrapped;
     _retryPolicy = Policy <object>
                    .Handle <RateLimitApiException>()
                    .WaitAndRetryAsync(3, x => TimeSpan.FromSeconds(retrySeconds),
                                       (result, span, context) => { reporter.Verbose("Rate limit exceeded, waiting before retrying."); });
 }
コード例 #3
0
 public RegisterModel(IConfiguration configuration,
                      IManagementConnection managementConnection,
                      IAuthenticationConnection authenticationConnection)
 {
     Configuration            = configuration;
     ManagementConnection     = managementConnection;
     AuthenticationConnection = authenticationConnection;
 }
 public Auth0ManagementApiClientProvider(
     EnvironmentSettings environmentSettings,
     IManagementConnection managementConnection
     )
 {
     _environmentSettings  = environmentSettings;
     _managementConnection = managementConnection;
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ManagementApiClient"/> class.
 /// </summary>
 /// <param name="token">A valid Auth0 Management API v2 token.</param>
 /// <param name="domain">Your Auth0 domain. <example>tenant.auth0.com</example></param>
 /// <param name="connection"></param>
 public ManagementApiClient(string token, string domain, IManagementConnection connection = null)
     : this(token, new Uri($"https://{domain}/api/v2"), connection)
 {
 }
コード例 #6
0
 /// <summary>
 /// Initializes a new instance on <see cref="JobsClient"/>
 /// </summary>
 /// <param name="connection"><see cref="IManagementConnection"/> used to make all API calls.</param>
 /// <param name="baseUri"><see cref="Uri"/> of the endpoint to use in making API calls.</param>
 /// <param name="defaultHeaders">Dictionary containing default headers included with every request this client makes.</param>
 public JobsClient(IManagementConnection connection, Uri baseUri, IDictionary <string, string> defaultHeaders)
     : base(connection, baseUri, defaultHeaders)
 {
 }
コード例 #7
0
 /// <summary>
 /// Initializes a new instance of <see cref="BaseClient"/>.
 /// </summary>
 /// <param name="connection"><see cref="IManagementConnection"/> used to make all API calls.</param>
 /// <param name="baseUri"><see cref="Uri"/> of the endpoint to use in making API calls.</param>
 /// <param name="defaultHeaders">Dictionary containing default headers included with every request this client makes.</param>
 protected BaseClient(IManagementConnection connection, Uri baseUri, IDictionary <string, string> defaultHeaders)
 {
     Connection     = connection ?? throw new ArgumentNullException(nameof(connection));
     BaseUri        = baseUri ?? throw new ArgumentNullException(nameof(baseUri));
     DefaultHeaders = defaultHeaders ?? throw new ArgumentNullException(nameof(defaultHeaders));
 }
コード例 #8
0
 public TestManagementApiClient(string token, string domain, IManagementConnection connection) : base(token, domain, connection)
 {
 }
コード例 #9
0
 public TestManagementApiClient(string token, Uri baseUrl, IManagementConnection connection = null) : base(token, baseUrl, connection)
 {
 }
コード例 #10
0
 public UserProfileService(HttpClient httpClient, IConfiguration configuration, IManagementConnection managementConnection)
 {
     _httpClient           = httpClient;
     _configuration        = configuration;
     _managementConnection = managementConnection;
 }
コード例 #11
0
 public ManagementApiClientFactory(IAuth0TokenFactory tokenFactory, IOptionsMonitor <Auth0AuthenticationConfig> config, IManagementConnection managementConnection)
 {
     _tokenFactory         = tokenFactory;
     _config               = config;
     _managementConnection = managementConnection;
 }
コード例 #12
0
 /// <summary>
 /// Initializes a new instance of <see cref="BlacklistedTokensClient"/>.
 /// </summary>
 /// <param name="connection"><see cref="IManagementConnection"/> used to make all API calls.</param>
 /// <param name="baseUri"><see cref="Uri"/> of the endpoint to use in making API calls.</param>
 /// <param name="defaultHeaders">Dictionary containing default headers included with every request this client makes.</param>
 public BlacklistedTokensClient(IManagementConnection connection, Uri baseUri, IDictionary <string, string> defaultHeaders)
     : base(connection, baseUri, defaultHeaders)
 {
 }
コード例 #13
0
 public AuthService(AuthOptions options, IManagementConnection managementConnection)
 {
     _options = options;
     _managementConnection = managementConnection;
 }