Sustainsys / Saml2

Saml2 Authentication services for ASP.NET
Other
957 stars 603 forks source link

TokenValidationParametersTemplate.NameClaimType isn't being respected #1379

Closed RobSiklos closed 1 year ago

RobSiklos commented 1 year ago

Using Sustainsys.Saml2.AspNetCore2 v2.9.0

I have authentication working using Sustainsys, but I am trying to make it so that the value of ClaimsIdentity.NameClaimType is what I want it to be.

To do this, I'm setting options.SPOptions.TokenValidationParametersTemplate.NameClaimType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"; However, it doesn't seem to work.

I've also tried inspecting things using options.Notifications.Unsafe.TokenValidationParametersCreated, but the delegate appears to never get hit.

Is there somewhere else that I can set something in order to have the correct NameClaimType value in the ClaimsIdentity?

Thanks in advance!

AndersAbel commented 1 year ago

This looks like a bug.

A workaround could be to update the created ClaimsIdentity in the AcsCommandResultCreated notification.

RobSiklos commented 1 year ago

I can no longer reproduce this. I think the problem is that I had stale cookies. We can close this.