Exemple #1
0
        public async Task CreateCustomToken(string tenantId)
        {
            var factory = CreateTokenFactory(tenantId);

            var token = await factory.CreateCustomTokenAsync("user1");

            MockCustomTokenVerifier.WithTenant(tenantId).Verify(token, "user1");
        }
Exemple #2
0
        public async Task CreateCustomTokenWithEmptyClaims(string tenantId)
        {
            var factory = CreateTokenFactory(tenantId);

            var token = await factory.CreateCustomTokenAsync(
                "user1", new Dictionary <string, object>());

            MockCustomTokenVerifier.WithTenant(tenantId).Verify(token, "user1");
        }
Exemple #3
0
        public async Task CreateCustomTokenWithClaims(string tenantId)
        {
            var factory         = CreateTokenFactory(tenantId);
            var developerClaims = new Dictionary <string, object>()
            {
                { "admin", true },
                { "package", "gold" },
                { "magicNumber", 42L },
            };

            var token = await factory.CreateCustomTokenAsync("user2", developerClaims);

            MockCustomTokenVerifier.WithTenant(tenantId).Verify(token, "user2", developerClaims);
        }