簡體   English   中英

Openiddict隱式流過早令牌到期

[英]Openiddict implicitflow premature token expiration

我的openiddict配置是

services.AddOpenIddict(options =>
        {
            options.AddEntityFrameworkCoreStores<TestDbContext>();
            options.AddMvcBinders();
            options.EnableAuthorizationEndpoint("/connect/authorize")
                   .EnableLogoutEndpoint("/connect/logout")
                   .EnableIntrospectionEndpoint("/connect/introspect")
                   .EnableUserinfoEndpoint("/api/userinfo");
            options.AllowImplicitFlow();
            options.RequireClientIdentification();
            options.EnableRequestCaching();
            options.DisableSlidingExpiration();
            options.AddSigningCertificate(
                assembly: typeof(Startup).GetTypeInfo().Assembly,
                resource: "Server.test.pfx",
                password: "test"); // embedded resource
            options.SetAccessTokenLifetime(TimeSpan.FromDays(1));
            options.SetIdentityTokenLifetime(TimeSpan.FromDays(1));
        });

當我在本地測試時,令牌的壽命似乎與上面指定的一樣長,但是在生產環境(Windows Server 2016 IIS 10)上,令牌過早過期(約1小時)。 netcore1和netcore2都是這種情況。 我知道我可以選擇進行靜默令牌續簽,但現在想避免該過程。 有這種行為的任何已知原因嗎?

當我在本地測試時,令牌的壽命似乎與上面指定的一樣長,但是在生產環境(Windows Server 2016 IIS 10)上,令牌過早過期(約1小時)。

默認情況下,OpenIddict使用ASP.NET Core數據保護來加密其訪問令牌。

為了使數據保護堆棧正常工作,必須在生產時對其進行配置。 有關更多信息,請參見OpenIddict:兩個或多個服務實例計數時出現401錯誤

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM