20 lines
638 B
C#
20 lines
638 B
C#
using Microsoft.AspNetCore.Authentication;
|
|
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
|
|
namespace Oqtane.Pages
|
|
{
|
|
public class OIDCModel : PageModel
|
|
{
|
|
public IActionResult OnGetAsync(string returnurl)
|
|
{
|
|
returnurl = (returnurl == null) ? "/" : returnurl;
|
|
returnurl = (!returnurl.StartsWith("/")) ? "/" + returnurl : returnurl;
|
|
|
|
return new ChallengeResult(OpenIdConnectDefaults.AuthenticationScheme,
|
|
new AuthenticationProperties { RedirectUri = returnurl });
|
|
}
|
|
}
|
|
}
|