Update signed out redirect url in sample

This commit is contained in:
Troy Dai 2016-07-28 10:05:50 -07:00
parent fa0a68a847
commit ed6984fab5
1 changed files with 11 additions and 5 deletions

View File

@ -81,7 +81,7 @@ namespace OpenIdConnect.AzureAdSample
ClientSecret = clientSecret, // for code flow ClientSecret = clientSecret, // for code flow
Authority = authority, Authority = authority,
ResponseType = OpenIdConnectResponseType.CodeIdToken, ResponseType = OpenIdConnectResponseType.CodeIdToken,
PostLogoutRedirectUri = "/usersignout", PostLogoutRedirectUri = "/signed-out",
// GetClaimsFromUserInfoEndpoint = true, // GetClaimsFromUserInfoEndpoint = true,
Events = new OpenIdConnectEvents() Events = new OpenIdConnectEvents()
{ {
@ -128,10 +128,16 @@ namespace OpenIdConnect.AzureAdSample
else if (context.Request.Path.Equals("/signout-remote")) else if (context.Request.Path.Equals("/signout-remote"))
{ {
await context.Authentication.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); await context.Authentication.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
await context.Authentication.SignOutAsync(OpenIdConnectDefaults.AuthenticationScheme, new AuthenticationProperties await context.Authentication.SignOutAsync(OpenIdConnectDefaults.AuthenticationScheme);
{ }
RedirectUri = "/remote-signedout" else if (context.Request.Path.Equals("/signed-out"))
}); {
await WriteHtmlAsync(context.Response,
async response =>
{
await response.WriteAsync($"<h1>You have been signed out.</h1>");
await response.WriteAsync("<a class=\"btn btn-primary\" href=\"/signin\">Sign In</a>");
});
} }
else if (context.Request.Path.Equals("/remote-signedout")) else if (context.Request.Path.Equals("/remote-signedout"))
{ {