Auth added to blazor

This commit is contained in:
2021-10-13 20:39:11 -04:00
parent 2552ad4d87
commit cccd609233
9 changed files with 153 additions and 16 deletions

20
Web/Pages/Login.cshtml.cs Normal file
View File

@@ -0,0 +1,20 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Web.Pages
{
public class Login : PageModel
{
// Can't be put into a razor page
public async Task OnGet(string redirectUri)
{
await HttpContext.ChallengeAsync(OpenIdConnectDefaults.AuthenticationScheme, new AuthenticationProperties()
{
RedirectUri = redirectUri
});
}
}
}