Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ protected override void Configure(ConfigureAuthenticationContext<WsFederationOpt
ctx.Request.Path == ctx.Options.CallbackPath &&
ctx.Request.Query.ContainsKey(identityServerOptions.UserInteraction.LogoutIdParameter))
{
ctx.Response.Redirect(identityServerOptions.UserInteraction.LogoutUrl + "?" + identityServerOptions.UserInteraction.LogoutIdParameter + "=" + ctx.Request.Query[identityServerOptions.UserInteraction.LogoutIdParameter]);
// Redirect only to the local logout page; the logout id is URL-encoded so it cannot alter the target.
var logoutId = ctx.Request.Query[identityServerOptions.UserInteraction.LogoutIdParameter].ToString();
var query = QueryString.Create(identityServerOptions.UserInteraction.LogoutIdParameter, logoutId);
ctx.Response.Redirect(identityServerOptions.UserInteraction.LogoutUrl + query.ToUriComponent());
ctx.HandleResponse();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ protected override void Configure(ConfigureAuthenticationContext<WsFederationOpt
ctx.Request.Path == ctx.Options.CallbackPath &&
ctx.Request.Query.ContainsKey(identityServerOptions.UserInteraction.LogoutIdParameter))
{
ctx.Response.Redirect(identityServerOptions.UserInteraction.LogoutUrl + "?" + identityServerOptions.UserInteraction.LogoutIdParameter + "=" + ctx.Request.Query[identityServerOptions.UserInteraction.LogoutIdParameter]);
// Redirect only to the local logout page; the logout id is URL-encoded so it cannot alter the target.
var logoutId = ctx.Request.Query[identityServerOptions.UserInteraction.LogoutIdParameter].ToString();
var query = QueryString.Create(identityServerOptions.UserInteraction.LogoutIdParameter, logoutId);
ctx.Response.Redirect(identityServerOptions.UserInteraction.LogoutUrl + query.ToUriComponent());
ctx.HandleResponse();
}

Expand Down
Loading