Auth added to blazor
This commit is contained in:
20
Web/Pages/Login.cshtml.cs
Normal file
20
Web/Pages/Login.cshtml.cs
Normal 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
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user