【问题标题】:bad request - request too long错误请求 - 请求太长
【发布时间】:2018-08-09 15:55:08
【问题描述】:

我使用 IdentityServer3。我的创业课程如下。

public class Startup
{
    public void Configuration(IAppBuilder app)
    {

        app.Map("/identity", idsrvApp =>
        {
            var corsPolicyService = new DefaultCorsPolicyService()
            {
                AllowAll = true
            };

            var idServerServiceFactory = new IdentityServerServiceFactory()
            .UseInMemoryClients(Clients.Get())
            .UseInMemoryScopes(Scopes.Get());
            //.UseInMemoryUsers(Users.Get());

            idServerServiceFactory.CorsPolicyService = new Registration<IdentityServer3.Core.Services.ICorsPolicyService>(corsPolicyService);

            idServerServiceFactory.ViewService = new Registration<IViewService, CustomViewService>();
            idServerServiceFactory.UserService = new Registration<IUserService>(resolver => new CustomUserService());

            var options = new IdentityServerOptions
            {
                EnableWelcomePage = false,
                Factory = idServerServiceFactory,
                SiteName = "Justice Identity Server",
                IssuerUri = IdentityConstants.ecabinetIssuerUri,
                PublicOrigin = IdentityConstants.ecabinetSTSOrigin,
                AuthenticationOptions = new IdentityServer3.Core.Configuration.AuthenticationOptions() {
                    CookieOptions = {
                      AllowRememberMe=false,
                      Prefix="IC"
                        },
                    EnablePostSignOutAutoRedirect = true,



                },

                SigningCertificate = LoadSertificate(),
                CspOptions = new CspOptions()
                {
                    Enabled = true,
                    ScriptSrc = "'unsafe-inline'",
                    ConnectSrc = "*",
                    FrameSrc = "*"
                },

            };


            idsrvApp.UseIdentityServer(options);

        });


    }
    X509Certificate2 LoadSertificate()
    {
        return new X509Certificate2(string.Format(@"{0}\certificates\cert.pfx", AppDomain.CurrentDomain.BaseDirectory), "123", X509KeyStorageFlags.MachineKeySet);
    }
}

有时我得到“错误的请求-请求太长”,当我清除 cookie 时它可以工作。我在控制台中看到了很多 nonce cookie。 任何人都可以帮助我吗? 谢谢你

【问题讨论】:

  • 对不起,“nonce cookies”。它们听起来不好吃:D

标签: c# .net identity identityserver3


【解决方案1】:

这是一个已知问题。 那里有更多信息:https://github.com/IdentityServer/IdentityServer3/issues/1124

【讨论】:

    猜你喜欢
    • 2020-09-24
    • 1970-01-01
    • 1970-01-01
    • 2014-08-23
    • 2018-02-16
    • 2021-07-01
    • 2019-01-09
    • 1970-01-01
    • 2018-10-06
    相关资源
    最近更新 更多