Restauration paramètres d'usine
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Http.Authentication;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
|
||||
@ -6,12 +7,20 @@ namespace Mvc.Client.Controllers {
|
||||
public class AuthenticationController : Controller {
|
||||
|
||||
[HttpGet("~/signin")]
|
||||
public ActionResult SignIn() {
|
||||
public ActionResult SignIn(string returnUrl="/") {
|
||||
// Instruct the OIDC client middleware to redirect the user agent to the identity provider.
|
||||
// Note: the authenticationType parameter must match the value configured in Startup.cs
|
||||
var properties = new AuthenticationProperties { RedirectUri = "http://localhost:5002/signin-yavsc" };
|
||||
// Note: the authenticationType parameter must match the value configured in Startup.cs.
|
||||
// But, this redirect URI doesn't need to match the OAuth parameter, it's serialized in the query state,
|
||||
// to be used once the identification ends.
|
||||
var properties = new AuthenticationProperties { RedirectUri = returnUrl };
|
||||
return new ChallengeResult("Yavsc", properties);
|
||||
}
|
||||
[HttpGet("~/signout")]
|
||||
public async Task<IActionResult> SignOut(string returnUrl="/") {
|
||||
await HttpContext.Authentication.SignOutAsync("Bearer");
|
||||
return Redirect(returnUrl);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user