일부 구성이 누락되었다고 확신합니다.Identity Server를 사용하여 20 분 동안 세션 시간 초과 쿠키 인증을 사용하는 하이브리드 흐름
아래와 같이 구성된 하이브리드 흐름에서 ASP.NET 코어 1.0 웹 사이트로 Identity Server 4
을 사용하여 새 앱을 테스트하고 있습니다.
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationScheme = "Cookies"
});
app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
{
AuthenticationScheme = "oidc",
SignInScheme = "Cookies",
Authority = "https://account.testsite.com",
RequireHttpsMetadata = true,
ClientId = "superId",
ClientSecret = "supersecretclient",
ResponseType = "code id_token",
Scope = { "api1", "offline_access", "profile", "openid" },
GetClaimsFromUserInfoEndpoint = true,
SaveTokens = true,
TokenValidationParameters = new TokenValidationParameters
{
NameClaimType = "name",
RoleClaimType = "role"
}
});
사용자는 웹 사이트에서의 활동과 관계없이 20 분이 지나면 로그 아웃됩니다. IdSrv4에 대한
클라이언트 설정은 다음과 같이이 :
Absolute refresh time: 2592000 Access token lifetime: 3600 Authorization code lifetime: 300 Identity token lifetime: 300 Sliding refresh token lifetime: 1296000
사용자 히트 페이지에서 새로 고침 경우
, 그는 즉시 그러나, 페이지가 실패 자동로드 기능을 가지고, 다시 자동으로 기록됩니다.
이 원하는 무엇 당신이 기대하는 행동? –
기본 쿠키 시간이 29 일이라고 가정 할 때 원하는 동작이 액세스 토큰 수명만큼 1 시간 이상으로 예상됩니다 ... –
질문에 클라이언트 구성을 게시하고 액세스 토큰 수명 3600 초, 그래서 1 시간입니다. 둘째, OpenIdConnectOptions의 [UseTokenLifetime'] (https://github.com/aspnet/Security/blob/10ef26d63c98c3966e7315aee172a7c3fd992520/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/OpenIdConnectOptions.cs#L235) 속성을 다음과 같이 사용할 수 있습니다. 세션 쿠키의 수명을 토큰의 수명과 동기화하십시오. 그러나 액세스 토큰이 아닌 ** ID ** 토큰 수명을 사용한다는 점을 알아 두십시오. –