看起来我想通了:登出页面加载了一个可以修改的 javascript 文件 (onload.js)。我向该文件添加了一个 javascript 函数,该函数将点击事件发送到注销按钮。
在 ADFS 服务器上打开 PowerShell。查看当前活跃的网络主题:
Get-AdfsWebConfig
这被设置为默认值。然后根据默认网页主题创建自定义网页主题:
New-AdfsWebTheme -Name Custom -SourceName Default
导出网页主题进行编辑:
Export-AdfsWebTheme -Name Custom -DirectoryPath C:\temp
需要编辑的文件是:C:\temp\scripts\onload.js。在最后添加这些行(我通过检查退出页面的源代码得到了退出按钮的 ID):
var signOutPanelExists = document.getElementById('idp_SignOutPanel');
if (signOutPanelExists)
{
// only click the SignOut button if it is displayed - to avoid endless loop
if (document.getElementById('idp_SignOutPanel').style.display != 'none')
{
var logoutKnopf = document.getElementById('idp_SignOutButton');
if (logoutKnopf)
{
window.onload = function(){ document.getElementById('idp_SignOutButton').click(); }
}
}
}
上传修改后的onload.js:
Set-AdfsWebTheme -TargetName Custom -AdditionalFileResource @{Uri='/adfs/portal/script/onload.js';path='C:\temp\script\onload.js'}
激活自定义网页主题:
set-adfswebconfig -ActiveThemeName Custom
现在,当用户退出网络应用程序时,他会完全退出,而无需按另一个退出按钮。
有关编辑登录和退出页面的更多信息:
https://technet.microsoft.com/en-us/library/dn636121(v=ws.11).aspx