I have a dedicated IdServer running that has the login page that other applications will boot unauthenticated users to.
My current pipeline is:
app.U
Just needed to add the AuthenticationManager
Challenge
:
app.Use(async (context, next) =>
{
var authService = context.RequestServices.GetRequiredService<IAuthorizationService>();
if (!await authService.AuthorizeAsync(context.User, context, "Api"))
{
await context.Authentication.ChallengeAsync("oidc");
}
else
{
await next();
}
});