/// <summary>
 /// Initializes a new instance of the <see cref="AuthorizationRoot" /> class.
 /// </summary>
 /// <param name="configurationManager">The configuration manager.</param>
 /// <param name="configurationSectionName">Name of the configuration section.</param>
 /// <param name="requestFactory">The request factory.</param>
 public AuthorizationRoot(
     IConfigurationManager configurationManager,
     string configurationSectionName,
     IRequestFactory requestFactory)
 {
     this.requestFactory  = requestFactory;
     configurationSection = configurationManager
                            .GetConfigSection <OAuth2ConfigurationSection>(configurationSectionName);
 }
Exemple #2
0
        public void Should_ContainAllServiceDefinitions()
        {
            var section = new OAuth2ConfigurationSection();

            // act
            _configuration.GetSection("oauth2").Bind(section);

            // assert
            section["SomeClient"].Should().NotBeNull();
            section["SomeAnotherClient"].Should().NotBeNull();
        }
Exemple #3
0
        public void Should_CorrectlyParseServiceDefinition()
        {
            var section = new OAuth2ConfigurationSection();

            // act
            _configuration.GetSection("oauth2").Bind(section);
            var service = section["SomeAnotherClient"];

            // assert
            service.ClientTypeName.Should().Be("SomeAnotherClient");
            service.ClientId.Should().Be("SomeAnotherClientId");
            service.ClientSecret.Should().Be("SomeAnotherClientSecret");
            service.Scope.Should().Be("SomeAnotherScope");
            service.RedirectUri.Should().Be("https://some-another-redirect-uri.net");
        }