public async Task When_Registering_A_Client_Then_No_Exception_Is_Thrown()
        {
            // ARRANGE
            InitializeFakeObjects();
            _httpClientFactoryStub.Setup(h => h.GetHttpClient()).Returns(_server.Client);
            _server.SharedCtx.Oauth2IntrospectionHttpClientFactory.Setup(h => h.GetHttpClient()).Returns(_server.Client);
            var grantedToken = await _clientAuthSelector.UseClientSecretPostAuth("stateless_client", "stateless_client")
                               .UseClientCredentials("register_client")
                               .ResolveAsync($"{baseUrl}/.well-known/openid-configuration").ConfigureAwait(false);

            // ACT
            var client = await _registrationClient.ResolveAsync(new SimpleIdServer.Dtos.Requests.ClientRequest
            {
                RedirectUris = new []
                {
                    "https://localhost"
                },
                ScimProfile            = true,
                PostLogoutRedirectUris = new []
                {
                    "http://localhost:5000/callback"
                },
                RequirePkce = true
            }, baseUrl + "/.well-known/openid-configuration", grantedToken.Content.AccessToken);

            // ASSERT
            Assert.NotNull(client);
            Assert.True(client.Content.ScimProfile);
        }
示例#2
0
        public async Task When_Registering_A_Client_Then_No_Exception_Is_Thrown()
        {
            const string baseUrl = "http://localhost:5000";

            // ARRANGE
            InitializeFakeObjects();
            _httpClientFactoryStub.Setup(h => h.GetHttpClient()).Returns(_server.Client);

            // ACT
            var client = await _registrationClient.ResolveAsync(new Core.Common.DTOs.Client
            {
                RedirectUris = new []
                {
                    "https://localhost"
                },
                ScimProfile = true
            }, baseUrl + "/.well-known/openid-configuration");

            // ASSERT
            Assert.NotNull(client);
            Assert.True(client.ScimProfile);
        }