Restauration paramètres d'usine

This commit is contained in:
2016-06-12 02:31:59 +02:00
parent 6654e599c9
commit 8ce7767672
6 changed files with 39 additions and 61 deletions

View File

@ -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);
}
}
}