public void Initialize()
        {
            var logger = new TestLogger <TheIdentityHubService>();

            _Server = WireMockServer.Start();

            if (_Server.Urls.Length < 1)
            {
                Assert.Fail("WireMockServer not started correctly");
                return;
            }

            var serviceCollection = new ServiceCollection();

            serviceCollection.AddCustomOptions(TheIdentityHubDefaults.AuthenticationScheme, options =>
            {
                options.TheIdentityHubUrl = new Uri(_Server.Urls[0]);
                options.Tenant            = "ggdghornl_test";
                options.ClientId          = "0";
                options.ClientSecret      = "supersecret";
                options.CallbackPath      = "/signin-identityhub";
                options.Backchannel       = new HttpClient();
            });
            var builder = serviceCollection.BuildServiceProvider();

            _Options = builder.GetService <IOptionsMonitor <TheIdentityHubOptions> >();

            _TheIdentityHubService = new TheIdentityHubService(_Options, logger);
        }
 public TestJwtClaimValidator(ITheIdentityHubService theIdentityHubService,
                              ILogger <TestJwtClaimValidator> logger)
 {
     _theIdentityHubService =
         theIdentityHubService ?? throw new ArgumentNullException(nameof(theIdentityHubService));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Exemplo n.º 3
0
 public JwtClaimValidator(ITheIdentityHubService theIdentityHubService, ILogger <JwtClaimValidator> logger,
                          IUtcDateTimeProvider dateTimeProvider, IIccPortalConfig iccPortalConfig)
 {
     _TheIdentityHubService =
         theIdentityHubService ?? throw new ArgumentNullException(nameof(theIdentityHubService));
     _Logger           = logger ?? throw new ArgumentNullException(nameof(logger));
     _DateTimeProvider = dateTimeProvider ?? throw new ArgumentNullException(nameof(dateTimeProvider));
     _IccPortalConfig  = iccPortalConfig ?? throw new ArgumentNullException(nameof(iccPortalConfig));
 }
        public TheIdentityHubServiceTests()
        {
            _Server = WireMockServer.Start();
            if (_Server.Urls.Length < 1)
            {
                throw new Exception("WireMockServer not started correctly");
            }

            _TheIdentityHubService = TestTheIdentityHubServiceCreator.CreateInstance(_Server);
        }
 public HttpGetAuthorisationRedirectCommand(IIccPortalConfig configuration,
                                            ILogger <HttpGetAuthorisationRedirectCommand> logger, IAuthCodeService authCodeService,
                                            IJwtService jwtService, ITheIdentityHubService theIdentityHubService, HttpGetLogoutCommand logoutCommand)
 {
     _configuration         = configuration ?? throw new ArgumentNullException(nameof(configuration));
     _logger                = logger ?? throw new ArgumentNullException(nameof(logger));
     _authCodeService       = authCodeService ?? throw new ArgumentNullException(nameof(authCodeService));
     _jwtService            = jwtService ?? throw new ArgumentNullException(nameof(jwtService));
     _theIdentityHubService = theIdentityHubService ?? throw new ArgumentNullException(nameof(theIdentityHubService));
     _logoutCommand         = logoutCommand ?? throw new ArgumentNullException(nameof(logoutCommand));
 }
 public JwtAuthenticationHandler(
     IOptionsMonitor <AuthenticationSchemeOptions> options,
     ILoggerFactory loggerFactory,
     UrlEncoder encoder,
     ISystemClock clock,
     IJwtService jwtService,
     ITheIdentityHubService theIdentityHubService) : base(options, loggerFactory, encoder, clock)
 {
     _JwtService            = jwtService ?? throw new ArgumentNullException(nameof(jwtService));
     _TheIdentityHubService =
         theIdentityHubService ?? throw new ArgumentNullException(nameof(theIdentityHubService));
 }
 public TheIdentityHubServiceTests()
 {
     _Server = WireMockServer.Start();
     Assert.False(_Server.Urls.Length < 1, "WireMockServer not started correctly");
     _TheIdentityHubService = TestTheIdentityHubServiceCreator.CreateInstance(_Server);
 }
 public HttpGetLogoutCommand(IIccPortalConfig configuration, ITheIdentityHubService theIdentityHubService)
 {
     _Configuration         = configuration ?? throw new ArgumentNullException(nameof(configuration));
     _TheIdentityHubService =
         theIdentityHubService ?? throw new ArgumentNullException(nameof(theIdentityHubService));
 }