Skip to content

Common claims

Hugo Biarge edited this page Feb 3, 2019 · 5 revisions

Common Claims

In the TestServerOptions you can configure a collection of common claims that will be included in the ClaimsPrincipal instance in addition to the received claims.

services.AddAuthentication(TestServerAuthenticationDefaults.AuthenticationScheme)
    .AddTestServer(options =>
    {
        options.CommonClaims = new[]
        {
            new Claim(ClaimTypes.AuthenticationInstant, Iso8601UtcNow()),
        };
    });