不好的请求 - 请求太久了

时间:2018-03-01 14:41:22

标签: c# .net identity identityserver3

我使用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);
    }
}

有时我得到了'#34;错误的请求 - 请求太长&#34; ,当我清除cookie它工作。我在控制台中看到了很多nonce cookies。 有人可以帮帮我吗? 谢谢你

1 个答案:

答案 0 :(得分:0)

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