Always enter credentials without “prompt=login” in IdentityServer4

后端 未结 2 1078
野性不改
野性不改 2021-01-24 23:37

This is similar to IdentityServer4 Force User to re-enter credentials, but the solution there says to use prompt=login query string in the /authorize U

2条回答
  •  旧时难觅i
    2021-01-25 00:10

    You should be able to achieve desired behaviour by overriding the default cookie scheme that AddIdentityServer() registers internally:

    services.AddIdentityServer()...
    
    services.AddAuthentication("CustomScheme")
        .AddCookie("CustomScheme", options =>
        {
            options.ExpireTimeSpan = ...;
        });
    

    Make sure you add the override scheme after AddIdentityServer(), the sequence here is important due to the way ASP.Net Core DI works.

提交回复
热议问题