该文档here将帮助你。您有兴趣指定一套AuthenticationOptions
的自定义设置。内,有感兴趣的三个属性:
EnableSignOutPrompt
表示IdentityServer是否显示注销确认页面。当客户端发起注销时,IdentityServer默认会要求用户确认。这是针对“注销垃圾邮件”的缓解技术。默认为true。
EnablePostSignOutAutoRedirect
获取或设置一个值,它指示是否IdentityServer自动重定向回传递给signout端点的验证post_logout_redirect_uri。默认为false。
PostSignOutAutoRedirectDelay
获取或重定向到post_logout_redirect_uri之前设置延迟(以秒计)。默认为0。
使用这三个设置,你应该能够调整IdentityServer3根据自己的喜好。
例如,您的Startup.cs
可能看起来像这样:
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.Map("/identity", idsrvApp =>
{
idsrvApp.UseIdentityServer(new IdentityServerOptions
{
AuthenticationOptions = new AuthenticationOptions()
{
EnableSignOutPrompt = false,
EnablePostSignOutAutoRedirect = true,
PostSignOutAutoRedirectDelay = 0
},
EnableWelcomePage = false,
Factory = Factory.Get(),
SigningCertificate = Certificate.Get(),
SiteName = "Identity Server Example"
});
});
}
}