app.MapGet(“/b”, async (context) =>
{
var s = “Fail”;
var identity = context.User?.Identity;
if (identity != null && identity.IsAuthenticated)
{
s = context.User?.Claims?.FirstOrDefault(c => c.Type.Contains(“LoginName”))?.Value ?? “”;
}
await context.Response.WriteAsync(s);
});
app.MapGet(“/b”, async (context) =>
{
var s = “Fail”;
var identity = context.User?.Identity;
if (identity != null && identity.IsAuthenticated)
{
s = “OK”;
}
await context.Response.WriteAsync(s);
});
app.MapGet(“/b”, async (context) =>
{
var s = “Fail”;
var identity = context.User?.Identity;
if (identity != null && identity.IsAuthenticated)
{
s = “OK”;
}
return new ContentResult { Content = s, ContentType = “text/plain”, StatusCode = 200 };
});
app.MapGet(“/b”, async (context) =>
{
var s = “Fail”;
var identity = context.User?.Identity;
if (identity != null && identity.IsAuthenticated)
{
s = “OK”;
}
return Task.FromResult(s);
});