I have a WIF RP, with multiple trusted issuers configured, e.g:
<trustedIssuers>
<add thumbprint="..." name="Issuer1" />
<add thumbprint="..." name="Issuer2" />
</trustedIssuers>
I'm trying to get hold of which particular issuer a token came from. I was hoping the IssuerNameRegistry.GetIssuerName(...) would do the trick, but it seems to return null unless the supplied token is a an X509SecurityToken.
In the WSFederationAuthenticationModule
's SecurityTokenReceived
event I observe the following;
The received SamlSecurityToken
exposes a SamlAssertion
which has a private field _issuerToken
, of type X509SecurityToken
.
So, the information is there it seems, I'm just not able to get hold of it.
In short, how do I figure out which trusted issuer issued the token? Any help appreciated.
PS! I'm aware that the token has not yet been validated in the SecurityTokenReceived
event. I would preferably get this information after the token has been validated.