Exemplo n.º 1
0
        public void Configure_NoServiceInfo_ReturnsExpected()
        {
            CloudFoundryJwtBearerOptions opts    = new CloudFoundryJwtBearerOptions();
            JwtBearerOptions             jwtOpts = new JwtBearerOptions();

            CloudFoundryJwtBearerConfigurer.Configure(null, jwtOpts, opts);
            Assert.True(opts.ValidateCertificates);
            Assert.Equal(opts.ClaimsIssuer, jwtOpts.ClaimsIssuer);
            Assert.Null(jwtOpts.BackchannelHttpHandler);
            Assert.NotNull(jwtOpts.TokenValidationParameters);
            Assert.Equal(opts.SaveToken, jwtOpts.SaveToken);
        }
Exemplo n.º 2
0
        public void Configure_WithServiceInfo_ReturnsExpected()
        {
            CloudFoundryJwtBearerOptions opts = new CloudFoundryJwtBearerOptions();
            SsoServiceInfo   info             = new SsoServiceInfo("foobar", "clientId", "secret", "http://domain");
            JwtBearerOptions jwtOpts          = new JwtBearerOptions();

            CloudFoundryJwtBearerConfigurer.Configure(info, jwtOpts, opts);
            Assert.Equal("http://domain" + CloudFoundryDefaults.JwtTokenKey, opts.JwtKeyUrl);
            Assert.True(opts.ValidateCertificates);
            Assert.Equal(opts.ClaimsIssuer, jwtOpts.ClaimsIssuer);
            Assert.Null(jwtOpts.BackchannelHttpHandler);
            Assert.NotNull(jwtOpts.TokenValidationParameters);
            Assert.Equal(opts.SaveToken, jwtOpts.SaveToken);
        }