Ejemplo n.º 1
0
        private void InitializeFakeObjects()
        {
            _httpClientFactoryStub = new Mock <IHttpClientFactory>();
            var addFilterOperation     = new AddFilterOperation(_httpClientFactoryStub.Object);
            var deleteFilterOperation  = new DeleteFilterOperation(_httpClientFactoryStub.Object);
            var getAllFiltersOperation = new GetAllFiltersOperation(_httpClientFactoryStub.Object);
            var updateFilterOperation  = new UpdateFilterOperation(_httpClientFactoryStub.Object);
            var getFilterOperation     = new GetFilterOperation(_httpClientFactoryStub.Object);

            _filterClient = new FilterClient(
                addFilterOperation,
                deleteFilterOperation,
                getAllFiltersOperation,
                updateFilterOperation,
                getFilterOperation
                );
            var postTokenOperation     = new PostTokenOperation(_httpClientFactoryStub.Object);
            var getDiscoveryOperation  = new GetDiscoveryOperation(_httpClientFactoryStub.Object);
            var introspectionOperation = new IntrospectOperation(_httpClientFactoryStub.Object);
            var revokeTokenOperation   = new RevokeTokenOperation(_httpClientFactoryStub.Object);

            _clientAuthSelector = new ClientAuthSelector(
                new TokenClientFactory(postTokenOperation, getDiscoveryOperation),
                new IntrospectClientFactory(introspectionOperation, getDiscoveryOperation),
                new RevokeTokenClientFactory(revokeTokenOperation, getDiscoveryOperation));
        }
Ejemplo n.º 2
0
 public AuthenticationProvider(
     AuthOptions options,
     IIdentityServerClientFactory identityServerClientFactory)
 {
     _authOptions        = options;
     _clientAuthSelector = identityServerClientFactory.CreateAuthSelector();
 }
Ejemplo n.º 3
0
        private void InitializeFakeObjects()
        {
            var services = new ServiceCollection();

            services.AddSimpleIdentityServerJwt();
            var provider = services.BuildServiceProvider();

            _jwsGenerator             = (IJwsGenerator)provider.GetService(typeof(IJwsGenerator));
            _jweGenerator             = (IJweGenerator)provider.GetService(typeof(IJweGenerator));
            _httpClientFactoryStub    = new Mock <IHttpClientFactory>();
            _smsHttpClientFactoryStub = new Mock <IHttpClientFactory>();
            var requestBuilder          = new RequestBuilder();
            var postTokenOperation      = new PostTokenOperation(_httpClientFactoryStub.Object);
            var getDiscoveryOperation   = new GetDiscoveryOperation(_httpClientFactoryStub.Object);
            var introspectionOperation  = new IntrospectOperation(_httpClientFactoryStub.Object);
            var revokeTokenOperation    = new RevokeTokenOperation(_httpClientFactoryStub.Object);
            var sendSmsOperation        = new SendSmsOperation(_smsHttpClientFactoryStub.Object);
            var getJsonWebKeysOperation = new GetJsonWebKeysOperation(_httpClientFactoryStub.Object);

            _clientAuthSelector = new ClientAuthSelector(
                new TokenClientFactory(postTokenOperation, getDiscoveryOperation),
                new IntrospectClientFactory(introspectionOperation, getDiscoveryOperation),
                new RevokeTokenClientFactory(revokeTokenOperation, getDiscoveryOperation));
            var getUserInfoOperation = new GetUserInfoOperation(_httpClientFactoryStub.Object);

            _sidSmsAuthenticateClient = new SidSmsAuthenticateClient(sendSmsOperation);
            _userInfoClient           = new UserInfoClient(getUserInfoOperation, getDiscoveryOperation);
            _jwksClient = new JwksClient(getJsonWebKeysOperation, getDiscoveryOperation);
        }
        public GenerateProxyWindowControl()
        {
            _isInitialized = false;
            var factory = new IdentityServerUmaManagerClientFactory();
            var identityServerClientFactory = new IdentityServerClientFactory();

            _clientAuthSelector = identityServerClientFactory.CreateTokenClient();
            _resourceClient     = factory.GetResourceClient();
            InitializeComponent();
            Loaded += Load;
        }
Ejemplo n.º 5
0
        private void InitializeFakeObjects()
        {
            _httpClientFactoryStub = new Mock <IHttpClientFactory>();
            var postTokenOperation     = new PostTokenOperation(_httpClientFactoryStub.Object);
            var getDiscoveryOperation  = new GetDiscoveryOperation(_httpClientFactoryStub.Object);
            var introspectionOperation = new IntrospectOperation(_httpClientFactoryStub.Object);
            var revokeTokenOperation   = new RevokeTokenOperation(_httpClientFactoryStub.Object);

            _clientAuthSelector = new ClientAuthSelector(
                new TokenClientFactory(postTokenOperation, getDiscoveryOperation),
                new IntrospectClientFactory(introspectionOperation, getDiscoveryOperation),
                new RevokeTokenClientFactory(revokeTokenOperation, getDiscoveryOperation));
        }
        private void InitializeFakeObjects()
        {
            var services = new ServiceCollection();

            services.AddSimpleIdentityServerJwt();
            var provider = services.BuildServiceProvider();

            _httpClientFactoryStub = new Mock <IHttpClientFactory>();
            var requestBuilder          = new RequestBuilder();
            var postTokenOperation      = new PostTokenOperation(_httpClientFactoryStub.Object);
            var getDiscoveryOperation   = new GetDiscoveryOperation(_httpClientFactoryStub.Object);
            var introspectionOperation  = new IntrospectOperation(_httpClientFactoryStub.Object);
            var revokeTokenOperation    = new RevokeTokenOperation(_httpClientFactoryStub.Object);
            var getJsonWebKeysOperation = new GetJsonWebKeysOperation(_httpClientFactoryStub.Object);

            _clientAuthSelector = new ClientAuthSelector(
                new TokenClientFactory(postTokenOperation, getDiscoveryOperation),
                new IntrospectClientFactory(introspectionOperation, getDiscoveryOperation),
                new RevokeTokenClientFactory(revokeTokenOperation, getDiscoveryOperation));
        }
Ejemplo n.º 7
0
        private void InitializeFakeObjects()
        {
            var services = new ServiceCollection();

            services.AddSimpleIdentityServerJwt();
            var provider = services.BuildServiceProvider();

            _jwsGenerator          = (IJwsGenerator)provider.GetService(typeof(IJwsGenerator));
            _jweGenerator          = (IJweGenerator)provider.GetService(typeof(IJweGenerator));
            _httpClientFactoryStub = new Mock <IHttpClientFactory>();
            var getAuthorizationOperation = new GetAuthorizationOperation(_httpClientFactoryStub.Object);
            var getDiscoveryOperation     = new GetDiscoveryOperation(_httpClientFactoryStub.Object);
            var postTokenOperation        = new PostTokenOperation(_httpClientFactoryStub.Object);
            var introspectionOperation    = new IntrospectOperation(_httpClientFactoryStub.Object);
            var revokeTokenOperation      = new RevokeTokenOperation(_httpClientFactoryStub.Object);

            _authorizationClient = new AuthorizationClient(getAuthorizationOperation, getDiscoveryOperation);
            _clientAuthSelector  = new ClientAuthSelector(
                new TokenClientFactory(postTokenOperation, getDiscoveryOperation),
                new IntrospectClientFactory(introspectionOperation, getDiscoveryOperation),
                new RevokeTokenClientFactory(revokeTokenOperation, getDiscoveryOperation));
        }
Ejemplo n.º 8
0
        private void InitializeFakeObjects()
        {
            var services = new ServiceCollection();

            services.AddSimpleIdentityServerJwt();
            var provider = services.BuildServiceProvider();

            _jwsGenerator             = provider.GetService <IJwsGenerator>();
            _httpClientFactoryStub    = new Mock <IHttpClientFactory>();
            _umaHttpClientFactoryStub = new Mock <SimpleIdentityServer.Uma.Client.Factory.IHttpClientFactory>();
            var postTokenOperation     = new PostTokenOperation(_httpClientFactoryStub.Object);
            var getDiscoveryOperation  = new GetDiscoveryOperation(_httpClientFactoryStub.Object);
            var introspectionOperation = new IntrospectOperation(_httpClientFactoryStub.Object);
            var revokeTokenOperation   = new RevokeTokenOperation(_httpClientFactoryStub.Object);

            _clientAuthSelector = new ClientAuthSelector(
                new TokenClientFactory(postTokenOperation, getDiscoveryOperation),
                new IntrospectClientFactory(introspectionOperation, getDiscoveryOperation),
                new RevokeTokenClientFactory(revokeTokenOperation, getDiscoveryOperation));
            _resourceSetClient = new ResourceSetClient(new AddResourceSetOperation(_umaHttpClientFactoryStub.Object),
                                                       new DeleteResourceSetOperation(_umaHttpClientFactoryStub.Object),
                                                       new GetResourcesOperation(_umaHttpClientFactoryStub.Object),
                                                       new GetResourceOperation(_umaHttpClientFactoryStub.Object),
                                                       new UpdateResourceOperation(_umaHttpClientFactoryStub.Object),
                                                       new GetConfigurationOperation(_umaHttpClientFactoryStub.Object),
                                                       new SearchResourcesOperation(_umaHttpClientFactoryStub.Object));
            _permissionClient = new PermissionClient(
                new AddPermissionsOperation(_umaHttpClientFactoryStub.Object),
                new GetConfigurationOperation(_umaHttpClientFactoryStub.Object));
            _policyClient = new PolicyClient(new AddPolicyOperation(_umaHttpClientFactoryStub.Object),
                                             new GetPolicyOperation(_umaHttpClientFactoryStub.Object),
                                             new DeletePolicyOperation(_umaHttpClientFactoryStub.Object),
                                             new GetPoliciesOperation(_umaHttpClientFactoryStub.Object),
                                             new AddResourceToPolicyOperation(_umaHttpClientFactoryStub.Object),
                                             new DeleteResourceFromPolicyOperation(_umaHttpClientFactoryStub.Object),
                                             new UpdatePolicyOperation(_umaHttpClientFactoryStub.Object),
                                             new GetConfigurationOperation(_umaHttpClientFactoryStub.Object),
                                             new SearchPoliciesOperation(_umaHttpClientFactoryStub.Object));
        }
Ejemplo n.º 9
0
 private void InitializeFakeObjects()
 {
     _tokenClientFactoryStub = new Mock <ITokenClientFactory>();
     _clientAuthSelector     = new ClientAuthSelector(_tokenClientFactoryStub.Object);
 }