Ejemplo n.º 1
0
        public void Configure_NoServiceInfo_ReturnsExpected()
        {
            // arrange
            CloudFoundryJwtBearerAuthenticationOptions opts = new CloudFoundryJwtBearerAuthenticationOptions();

            // act
            CloudFoundryJwtOwinConfigurer.Configure(null, opts);

            // assert
            Assert.Equal("http://" + CloudFoundryDefaults.OAuthServiceUrl + CloudFoundryDefaults.JwtTokenUri, opts.JwtKeyUrl);
            Assert.True(opts.ValidateCertificates); // <- default value
            Assert.NotNull(opts.TokenValidationParameters);
        }
Ejemplo n.º 2
0
        public void Configure_WithServiceInfo_ReturnsExpected()
        {
            // arrange
            CloudFoundryJwtBearerAuthenticationOptions opts = new CloudFoundryJwtBearerAuthenticationOptions();

            Assert.Null(opts.TokenValidationParameters);
            SsoServiceInfo info = new SsoServiceInfo("foobar", "clientId", "secret", "http://domain");

            // act
            CloudFoundryJwtOwinConfigurer.Configure(info, opts);

            // assert
            Assert.Equal("http://domain" + CloudFoundryDefaults.JwtTokenUri, opts.JwtKeyUrl);
            Assert.True(opts.ValidateCertificates); // <- default value
            Assert.NotNull(opts.TokenValidationParameters);
        }