public MAuthRequestRetrier(MAuthOptionsBase options) { var signingHandler = new MAuthSigningHandler(options: new MAuthSigningOptions() { ApplicationUuid = options.ApplicationUuid, PrivateKey = options.PrivateKey, }, innerHandler: options.MAuthServerHandler ?? new HttpClientHandler() ); client = new HttpClient(signingHandler) { Timeout = TimeSpan.FromSeconds(options.AuthenticateRequestTimeoutSeconds) }; }
public MAuthAuthenticator(MAuthOptionsBase options, ILogger logger) { if (options.ApplicationUuid == default(Guid)) { throw new ArgumentException(nameof(options.ApplicationUuid)); } if (options.MAuthServiceUrl == null) { throw new ArgumentNullException(nameof(options.MAuthServiceUrl)); } if (string.IsNullOrWhiteSpace(options.PrivateKey)) { throw new ArgumentNullException(nameof(options.PrivateKey)); } this.options = options; this.logger = logger; }
public MAuthAuthenticator(MAuthOptionsBase options) { if (options.ApplicationUuid == default(Guid)) { throw new ArgumentException(nameof(options.ApplicationUuid)); } if (options.MAuthServiceUrl == null) { throw new ArgumentNullException(nameof(options.MAuthServiceUrl)); } if (string.IsNullOrWhiteSpace(options.PrivateKey)) { throw new ArgumentNullException(nameof(options.PrivateKey)); } this.options = options; retrier = new MAuthRequestRetrier(options); }
public MAuthRequestRetrier(MAuthOptionsBase options) { var signingHandler = new MAuthSigningHandler(options: new MAuthSigningOptions() { ApplicationUuid = options.ApplicationUuid, PrivateKey = options.PrivateKey }, innerHandler: options.MAuthServerHandler ?? #if NETSTANDARD1_4 new HttpClientHandler() #else new WebRequestHandler() { CachePolicy = new RequestCachePolicy(RequestCacheLevel.Default) } #endif ); client = new HttpClient(signingHandler); client.Timeout = TimeSpan.FromSeconds(options.AuthenticateRequestTimeoutSeconds); }