I have this in my startup:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperE
You could write your own middleware to add new claims.
public class YourCustomMiddleware
{
private readonly RequestDelegate _next;
public YourCustomMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task InvokeAsync(HttpContext httpContext)
{
if (httpContext.User != null && httpContext.User.Identity.IsAuthenticated)
{
httpContext.User.Identities.FirstOrDefault().AddClaim(new Claim("your claim", "your field"));
}
await _next(httpContext);
}
}
and in your app startup
app.UseAuthentication();
app.UseMiddleware();