Skip to content

Instantly share code, notes, and snippets.

@mxmissile
Created June 21, 2022 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxmissile/572cb93da56650d7f58b069069970510 to your computer and use it in GitHub Desktop.
Save mxmissile/572cb93da56650d7f58b069069970510 to your computer and use it in GitHub Desktop.
api auth
builder.Services.Configure<JwtBearerOptions>(options =>
{
options.Events.OnChallenge += OnChallenge;
});
builder.Services.AddAuthentication().AddMicrosoftIdentityWebApi(builder.Configuration);
async Task OnChallenge(JwtBearerChallengeContext context)
{
Debug.WriteLine("hit me");
await Task.CompletedTask.ConfigureAwait(false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment