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
Asked
Active
Viewed 565 times
1 Answers
2
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));

Anders Revsgaard
- 3,636
- 1
- 9
- 25
-
1Thanks a lot .I will change the code and let u know. – Deepak Nov 10 '20 at 08:46
-
1I'm wondering if you had any lock. Please rate the answer if it was helpful. – Anders Revsgaard Nov 29 '20 at 11:52