With WIF (Windows Identity Foundation) 4.5, Microsoft created the WindowsPrincipal
class, which is a type of ClaimsPrincipal
. Of course, these classes aren't portable, but the interfaces behind them are (IPrincipal
). The same can be said of the ClaimsIndentity
class implementing the IIdentity
interface.
The problem I have is that these classes, and WIF in general is based entirely on the concept of "claims", which is awesome... but the two interfaces, IPrincipal
and IIdentity
are not. Not only that, but the ClaimsPrincipal
class also has a collection of Identities instead of just a single Identity associated to it.
- IPrincipal has
Identity
andIsInRole
members. - IIdentity has
AuthenticationType
,IsAuthenticated
, andName
members.
Given the fact that the Portable Class Libraries can only access these two interfaces, how does one go about getting the actual claims?
Also, in the rare instance that a principal has multiple identities, how does one get the "non-primary" identities?