Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Auth0TokenProvider" /> class.
 /// </summary>
 /// <param name="defaultSettings">The settings.</param>
 /// <param name="autoScheduler">The auto-scheduler that refreshes the Auth0 token after X minutes.</param>
 public Auth0TokenProvider(ILoggerFactory loggerFactory, Auth0ClientSettings defaultSettings,
                           IAuthenticationApiClient authenticationApiClient = null, IAutoScheduler autoScheduler = null)
     : base(loggerFactory, defaultSettings, authenticationApiClient)
 {
     this.autoScheduler = autoScheduler ?? new AutoScheduler(loggerFactory, this);
     defaultPassword    = defaultSettings.Auth0Password;
     defaultUsername    = defaultSettings.Auth0Username;
     defaultConnection  = defaultSettings.Auth0Connection;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="Auth0TokenProvider" /> class.
 /// </summary>
 /// <param name="defaultSettings">The settings.</param>
 /// <param name="autoScheduler">The auto-scheduler that refreshes the Auth0 token after X minutes.</param>
 public Auth0TokenProvider(ILoggerFactory loggerFactory, Auth0ClientSettings defaultSettings,
     IAuthenticationApiClient authenticationApiClient = null, IAutoScheduler autoScheduler = null)
     : base(loggerFactory, defaultSettings, authenticationApiClient)
 {
     this.autoScheduler = autoScheduler ?? new AutoScheduler(loggerFactory, this);
     defaultPassword = defaultSettings.Auth0Password;
     defaultUsername = defaultSettings.Auth0Username;
     defaultConnection = defaultSettings.Auth0Connection;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="Auth0TokenProvider" /> class.
 /// </summary>
 /// <param name="loggerFactory">The logger factory.</param>
 /// <param name="defaultSettings">The settings.</param>
 /// <param name="authenticationApiClient">The optional AuthenticationApiClient to use. Usually not required to use the built-in client.</param>
 /// <param name="autoScheduler">The auto-scheduler that refreshes the Auth0 token after X minutes.</param>
 public Auth0TokenProvider(ILoggerFactory loggerFactory, Auth0ClientSettings defaultSettings, IAuthenticationApiClient authenticationApiClient = null, IAutoScheduler autoScheduler = null)
 {
     this.autoScheduler           = autoScheduler ?? new AutoScheduler(loggerFactory, this);
     this.authenticationApiClient = authenticationApiClient ?? new AuthenticationApiClient();
     clientTokenCache             = new ConcurrentDictionary <string, Auth0ClientSettings>();
     domainClientIdCache          = new ConcurrentDictionary <string, string>();
     logger                  = loggerFactory.CreateLogger <Auth0TokenProvider>();
     defaultDomain           = defaultSettings.Auth0ServerUrl;
     defaultPassword         = defaultSettings.Auth0Password;
     defaultUsername         = defaultSettings.Auth0Username;
     defaultConnection       = defaultSettings.Auth0Connection;
     defaultRefreshToken     = defaultSettings.Auth0RefreshToken;
     defaultAutoRefreshAfter = defaultSettings.AutoRefreshAfter;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="Auth0v2TokenProvider" /> class.
 /// </summary>
 /// <param name="defaultSettings">The settings.</param>
 /// <param name="autoScheduler">The auto-scheduler that refreshes the Auth0 token after X minutes.</param>
 public Auth0v2TokenProvider(ILoggerFactory loggerFactory, Auth0ClientSettings defaultSettings, IAuthenticationApiClient authenticationApiClient = null, IAutoScheduler autoScheduler = null) : base(loggerFactory, defaultSettings, authenticationApiClient)
 {
     this.autoScheduler = autoScheduler ?? new AutoScheduler(loggerFactory, this);
     defaultClientSecret = defaultSettings.Auth0ClientSecret;
     defaultAudience = defaultSettings.Auth0Audience;
 }
Exemple #5
0
 internal void ScheduleAutoRefresh(Auth0ClientSettings auth0ClientSettings, IAutoScheduler autoScheduler)
 {
     autoScheduler.ScheduleRefresh(auth0ClientSettings);
 }
 internal void ScheduleAutoRefresh(Auth0ClientSettings auth0ClientSettings, IAutoScheduler autoScheduler)
 {
     autoScheduler.ScheduleRefresh(auth0ClientSettings);
 }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Auth0v2TokenProvider" /> class.
 /// </summary>
 /// <param name="defaultSettings">The settings.</param>
 /// <param name="autoScheduler">The auto-scheduler that refreshes the Auth0 token after X minutes.</param>
 public Auth0v2TokenProvider(ILoggerFactory loggerFactory, Auth0ClientSettings defaultSettings, IAuthenticationApiClient authenticationApiClient = null, IAutoScheduler autoScheduler = null) : base(loggerFactory, defaultSettings, authenticationApiClient)
 {
     this.autoScheduler  = autoScheduler ?? new AutoScheduler(loggerFactory, this);
     defaultClientSecret = defaultSettings.Auth0ClientSecret;
     defaultAudience     = defaultSettings.Auth0Audience;
 }