public async Task <string> DecryptIdentityTokenByResolution(
            string jwe,
            string configurationUrl)
        {
            if (string.IsNullOrWhiteSpace(configurationUrl))
            {
                throw new ArgumentNullException(nameof(configurationUrl));
            }

            var discoveryInformation = await _discoveryClient.GetDiscoveryInformationAsync(configurationUrl);

            return(await DecryptIdentityToken(jwe, discoveryInformation.JwksUri));
        }
Exemple #2
0
        public async Task When_Retrieving_DiscoveryInformation_Then_No_Exception_Is_Thrown()
        {
            const string baseUrl = "http://localhost:5000";

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

            // ACT
            var discovery = await _discoveryClient.GetDiscoveryInformationAsync(baseUrl + "/.well-known/openid-configuration");

            // ASSERT
            Assert.NotNull(discovery);
            Assert.True(discovery.ScimEndpoint == FakeStartup.ScimEndPoint);
        }