I'm using Asp.net Core 2.2 with AzureAD authentication. It works correctly, but now I'm having trouble trying to implement a log-out url.
I tried the following in my controller:
[HttpGet("[action]")]
public IActionResult SignOut()
{
return SignOut(new AuthenticationProperties { RedirectUri = Url.Action(nameof(AfterSignOut)) }, AzureADDefaults.AuthenticationScheme);
}
[HttpGet("[action]")]
[AllowAnonymous]
public IActionResult AfterSignOut()
{
return Ok("It's working!");
}
When I go with the browser to https://mySite/myController/SignOut the log-out operation works correctly (my user gets signed out, and the next time I go to a page I have to sign-in again)
Hhowever, the problem is that I am not redirected to the https://mySite/myController/AfterSignOut url, as specified in the AuthenticationProperties. What happens instead is that /SignOut just returns HTTP code 200 and that's it, it doesn't redirect me anywhere.
What am I doing wrong here?