Beispiel #1
0
        public DefaultAuthServer(
            IClientValidator clientValidator
            , ITokenGenerator tokenGenerator
            , IAuthCodeStore authCodeStore
            , ITokenInfoStore tokenStore
            , IStateStore stateStore
            , IAuthCodeGenerator authCodeGenerator
            , IResourceOwnerValidator resourceOwnerValidator
            , ILogger <DefaultAuthServer> logger
            , AuthServerOptions options
            , IPkceValidator pkceValidator
            , IConfiguration configuration
            )
        {
            _clientValidator        = clientValidator;
            _tokenGenerator         = tokenGenerator;
            _resourceOwnerValidator = resourceOwnerValidator;
            _logger            = logger;
            _authCodeStore     = authCodeStore;
            _tokenStore        = tokenStore;
            _stateStore        = stateStore;
            _authCodeGenerator = authCodeGenerator;
            _pkceValidator     = pkceValidator;
            _configuration     = configuration;

            TokenRequestHandler      = HandleTokenRequestAsync;
            AuthorizeRequestHandler  = HandleAuthorizeRequestAsync;
            EndSessionRequestHandler = HandleEndSessionRequestAsync;
            ClearTokenRequestHandler = HandleClearTokenRequestAsync;
            AuthServerOptions        = options;
        }
Beispiel #2
0
        public AuthCodeServiceTests()
        {
            var randomNumberGenerator = new StandardRandomNumberGenerator();

            _AuthCodeGenerator = new AuthCodeGenerator(randomNumberGenerator);
            var cache = new MemoryDistributedCache(Options.Create(new MemoryDistributedCacheOptions()));

            _AuthCodeService = new AuthCodeService(cache, _AuthCodeGenerator);
        }
Beispiel #3
0
 public AuthCodeService(IDistributedCache cache,
                        IAuthCodeGenerator authCodeGenerator)
 {
     _Cache             = cache ?? throw new ArgumentNullException(nameof(cache));
     _AuthCodeGenerator = authCodeGenerator ?? throw new ArgumentNullException(nameof(authCodeGenerator));
 }