I have this in my startup:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperE
It depends on what do you want to do and which scheme you use.
For example, if you use JwtBearer
then you could utilize JwtBearerOptions.Events
to handle particular events raised by the middleware. You need to set that in your ConfigureServices
method of Startup
class.
That would give you more granular control of what precise case you want to have your Claims added to, for example, OnTokenValidated
.