Common claims - Xabaril/Acheve.TestHost GitHub Wiki

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()),
        };
    });