示例#1
0
        public void Configure_NoOptions_ReturnsExpected()
        {
            // arrange
            SsoServiceInfo info = new SsoServiceInfo("foobar", "clientId", "secret", "http://domain");

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

            // nothing to assert
            Assert.True(true, "If we got here, we didn't attempt to set properties on a null object");
        }
示例#2
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);
        }
示例#3
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);
        }