your question is not clear, but I think you want to add a login facade to your app. the easiest to add your own middleware that checks for authentication,. trival example
...
app.UseHttpsRedirection();
app.Use(async (context, next) =>
{
var cookie = context.Request.Cookies["templogin"];
if (cookie?.FirstOrDefault().ToString() != "ok")
{
if (context.Request.Query["user"].FirstOrDefault() == "test"
&& context.Request.Query["password"].FirstOrDefault() == "password")
{
context.Response.Cookies.Append("templogin", "ok", new CookieOptions
{
Expires = DateTime.Now.AddDays(1),
Path = "/"
});
}
else
{
await context.Response.WriteAsync("Site not available");
return;
}
}
// Call the next delegate/middleware in the pipeline.
await next(context);
});
...
to login:
https://mysite.com?user=test&password=password
note: to improve security use an encrypted token for "ok". and a database (or environment variables) for user & password hash