Reputation: 83
Am using SAML2.0 AUTH with help of ITfoxtec.Identity.Saml2.Mvc package but I need to increase the session timeout to a 2 to 3 days . But currently default value there . How We can override the session time out . With .net core 3.1
Upvotes: 3
Views: 938
Reputation: 4334
You can set a custom session timeout in the AssertionConsumerService
method in the Auth Controller. Se documentation.
Set session timeout to 2 days:
await saml2AuthnResponse.CreateSession(HttpContext,
lifetime: new TimeSpan(2, 0,0,0),
claimsTransform: (claimsPrincipal) => ClaimsTransform.Transform(claimsPrincipal));
It is also possible to configure the session as persistence:
await saml2AuthnResponse.CreateSession(HttpContext,
lifetime: new TimeSpan(2, 0,0,0), isPersistent: true,
claimsTransform: (claimsPrincipal) => ClaimsTransform.Transform(claimsPrincipal));
Upvotes: 2