Setting HttpContext.User when login with Sustainsys-saml2

Viewed 17

We've implemented SAML2 authentication with the Sustainsys.Saml2 library, this is on a webforms project with .Net 4.7.2
The configuration of Sustainsys is in the web.config file, we can't change anything about the identity provider

After loggin in, we can read the unique identifier that we need for the current user:

var claims = System.Security.Claims.ClaimsPrincipal.Current.Claims;
var name = claims.First(c => c.Type == "urn:oid:0.9.2342.19200300.100.1.1").Value;

but we would like that it would be present also in HttpContext.Current.User.Identity.Name

Is there a way to configure Sustainsys (keeping the app as a webform, with the OWIN integration) so that it can read that specific claim as the User.Name when it performs the authentication?

Some configuration attribute for web.config or code for global.asax?

0 Answers
Related