I recently adapted your sample as WS-Federation signin implementation for the IdentityServer of my organization. After taking the the new release to production I had a client who complained that the claim mapping doesn't work anymore at his side.
He got this error page on client-side:
After some investigation I realized the problem is that the attribute a:OriginalIssuer of saml:Attribute in the WS-Federation response is set to LOCAL AUTHORITY instead of the correct issuer uri of our IdentityServer. I found out that LOCAL AUTHORITY is just the default value for this attribute in the Claim class in System.Security.Claims (see this StackOverflow).
Setting the OriginalIssuer-attribute of each claim to the right issuer uri of IdentityServer solved the problem. I created this PR to share the solution with you.
Why didn't this happen with the official sample for .NET Framework?
Because the OriginalIssuer attribute wasn't there. It seems to be a new behavior that was introduced with the AzureAD IdentityModel library.
I recently adapted your sample as WS-Federation signin implementation for the IdentityServer of my organization. After taking the the new release to production I had a client who complained that the claim mapping doesn't work anymore at his side.
He got this error page on client-side:
After some investigation I realized the problem is that the attribute
a:OriginalIssuer
of saml:Attribute in the WS-Federation response is set toLOCAL AUTHORITY
instead of the correct issuer uri of our IdentityServer. I found out thatLOCAL AUTHORITY
is just the default value for this attribute in the Claim class in System.Security.Claims (see this StackOverflow).Setting the OriginalIssuer-attribute of each claim to the right issuer uri of IdentityServer solved the problem. I created this PR to share the solution with you.
Sample WS-Federation response:
Before:
After:
Why didn't this happen with the official sample for .NET Framework? Because the OriginalIssuer attribute wasn't there. It seems to be a new behavior that was introduced with the AzureAD IdentityModel library.