URL-адрес выхода из ADFS в браузере выглядит следующим образом (правильно, проблем с кодировкой нет):
Код: Выделить всё
https://srvadfs.oc.gov.ma/adfs/ls/?wtrealm=https%3A%2F%2Ffdfp.oc.gov.ma%2FWorkflow
&wa=wsignout1.0
&wreply=https%3A%2F%2Ffdfp.oc.gov.ma%2FWorkflow%2Flogin.aspx
Код: Выделить всё
using Microsoft.Owin.Security.Cookies;
using Microsoft.Owin.Security.WsFederation;
using Owin;
using System.Configuration;
[assembly: OwinStartup("WebAppStartup", typeof(WebApplication.Startup))]
namespace WebApplication
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(
CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = CookieAuthenticationDefaults.AuthenticationType
});
app.UseWsFederationAuthentication(new WsFederationAuthenticationOptions
{
MetadataAddress = ConfigurationManager.AppSettings["AdfsMetadataAddress"],
Wtrealm = ConfigurationManager.AppSettings["WtrealmAppUrl"],
Wreply = ConfigurationManager.AppSettings["WreplyAppUrl"],
SignInAsAuthenticationType = CookieAuthenticationDefaults.AuthenticationType,
Notifications = new WsFederationAuthenticationNotifications
{
RedirectToIdentityProvider = context =>
{
if (context.ProtocolMessage.IsSignOutMessage)
{
context.ProtocolMessage.Wreply = ConfigurationManager.AppSettings["SignOutRedirectUrl"];
}
return System.Threading.Tasks.Task.FromResult(0);
}
}
});
}
}
}
Код: Выделить всё
protected void btnLogout_Click(object sender, EventArgs e)
{
Session.Clear();
Session.Abandon();
if (Request.Cookies != null)
{
foreach (string cookie in Request.Cookies.AllKeys)
Response.Cookies[cookie].Expires = DateTime.Now.AddDays(-1);
}
var ctx = HttpContext.Current.GetOwinContext();
ctx.Authentication.SignOut(
CookieAuthenticationDefaults.AuthenticationType,
WsFederationAuthenticationDefaults.AuthenticationType
);
}
Код: Выделить всё
Ожидаемое: После выхода ADFS обрабатывает wreply и перенаправляет браузер на https://fdfp.oc.gov.ma/Workflow/login.aspx. на странице входа, где я выполнил задачу входа в систему adfs

Фактическое: ADFS показывает собственную встроенную страницу выхода ("Déconnexion — Vous vous êtes déconnecté.") и остается там. Параметр wreply присутствует в URL, но полностью игнорируется.
Подробнее здесь: https://stackoverflow.com/questions/799 ... ogout-page
Мобильная версия