如何从asp.net identityserver3中删除注销和已注销的页面 [英] how to remove logout and loggedout paged from asp.net identityserver3

查看:83
本文介绍了如何从asp.net identityserver3中删除注销和已注销的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只希望对我的应用程序进行简单的单点登录,并且IdentityServer3被视为一个很好的解决方案.通过同意页面,注销页面和注销页面,我不喜欢它的三件事.通过将这些行设置到Clients.cs文件,我设法禁用了同意页面

I just want a simple single sign-on for my application and identityserver3 seen to be a good solution. three things i didn't like about it though the consent page, the logout and logged out pages. i manage to disable the consent page by setting these lines to the Clients.cs file

RequireConsent = false,
AllowRememberConsent = false,

我还在自定义视图服务"上的文档之后添加了自定义视图.

i also added custom view following the docs on Custom View Service.

现在,如何禁用注销和注销页面,以便当用户单击注销"按钮时自动将用户发送到首页?

so now How do I disable the logout and loggedout pages so that it automatically send the user to the home page when they clicks the sign out button?

推荐答案

文档这里会为您提供帮助.您有兴趣指定自定义集AuthenticationOptions.其中,包含三个感兴趣的属性:

The documentation here will help you. You are interested in specifying a custom set of AuthenticationOptions. Within that, there are three properties of interest:

  1. EnableSignOutPrompt

指示IdentityServer是否将显示用于注销的确认页面.当客户端启动注销时,默认情况下,IdentityServer将要求用户进行确认.这是针对注销垃圾邮件"的缓解技术.默认为true.

Indicates whether IdentityServer will show a confirmation page for sign-out. When a client initiates a sign-out, by default IdentityServer will ask the user for confirmation. This is a mitigation technique against "logout spam". Defaults to true.

  • EnablePostSignOutAutoRedirect

    获取或设置一个值,该值指示IdentityServer是否自动重定向回传递给注销端点的经过验证的post_logout_redirect_uri.默认为false.

    Gets or sets a value indicating whether IdentityServer automatically redirects back to a validated post_logout_redirect_uri passed to the signout endpoint. Defaults to false.

  • PostSignOutAutoRedirectDelay

    获取或设置重定向到post_logout_redirect_uri之前的延迟(以秒为单位).默认为0.

    Gets or sets the delay (in seconds) before redirecting to a post_logout_redirect_uri. Defaults to 0.

  • 使用这三个设置,您应该可以根据自己的喜好来调整IdentityServer3.

    Using these three settings you should be able to tweak IdentityServer3 to your liking.

    例如,您的Startup.cs可能看起来像这样:

    For example, your Startup.cs may look like this:

    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"
                });
            });
        }
    }
    

    这篇关于如何从asp.net identityserver3中删除注销和已注销的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆