Beispiel #1
0
        public AuthService(IHttpContextAccessor httpContextAccessor,
                           ITokenRefreshAgent tokenRefreshAgent,
                           IUrlHelperFactory urlHelperFactory,
                           IOptions <AuthOptions> options,
                           IAuthenticationService authenticationService)
        {
            if (httpContextAccessor == null)
            {
                throw new ArgumentNullException($"{nameof(httpContextAccessor)} cannot be null.");
            }
            if (tokenRefreshAgent == null)
            {
                throw new ArgumentNullException($"{nameof(tokenRefreshAgent)} cannot be null.");
            }
            if (urlHelperFactory == null)
            {
                throw new ArgumentNullException($"{nameof(urlHelperFactory)} cannot be null.");
            }
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options), $"{nameof(options)} cannot be null");
            }
            if (authenticationService == null)
            {
                throw new ArgumentNullException(nameof(authenticationService), $"{nameof(authenticationService)} cannot be null");
            }

            _httpContextAccessor   = httpContextAccessor;
            _tokenRefreshAgent     = tokenRefreshAgent;
            _urlHelperFactory      = urlHelperFactory;
            _authOptions           = options.Value;
            _authenticationService = authenticationService;
        }
Beispiel #2
0
        public AuthService(IHttpContextAccessor httpContextAccessor,
                           ITokenRefreshAgent tokenRefreshAgent,
                           IUrlHelperFactory urlHelperFactory)
        {
            if (httpContextAccessor == null)
            {
                throw new ArgumentNullException($"{nameof(httpContextAccessor)} cannot be null.");
            }
            if (tokenRefreshAgent == null)
            {
                throw new ArgumentNullException($"{nameof(tokenRefreshAgent)} cannot be null.");
            }
            if (urlHelperFactory == null)
            {
                throw new ArgumentNullException($"{nameof(urlHelperFactory)} cannot be null.");
            }

            _httpContextAccessor = httpContextAccessor;
            _tokenRefreshAgent   = tokenRefreshAgent;
            _urlHelperFactory    = urlHelperFactory;
        }
 public HomeController(ITokenRefreshAgent tokenRefreshAgent)
 {
     _tokenRefreshAgent = tokenRefreshAgent;
 }
 public TokenRefreshHandler(IOptions <AuthOptions> options, ITokenRefreshAgent tokenRefreshAgent, ILogger <TokenRefreshHandler> logger)
 {
     _authOptions       = options.Value;
     _tokenRefreshAgent = tokenRefreshAgent;
     _logger            = logger;
 }