3

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

Deepak
  • 83
  • 4

1 Answers1

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