Class ClaimsProfileFiller
An IClaimProfileFiller that builds the UserProfile from the claims of a ClaimsIdentity (name, given name, surname, e-mail, user principal name, company, phones, culture and security identifier).
[Export(typeof(IClaimProfileFiller))]
[Shared]
public class ClaimsProfileFiller : IClaimProfileFiller, IProfileFiller
- Inheritance
-
ClaimsProfileFiller
- Implements
- Inherited Members
Constructors
ClaimsProfileFiller(IOptionsMonitor<SimpleKeyValueSettings>)
Initializes a new instance of the ClaimsProfileFiller class.
public ClaimsProfileFiller(IOptionsMonitor<SimpleKeyValueSettings> domainMapping)
Parameters
domainMappingIOptionsMonitor<SimpleKeyValueSettings>The options, named
DomainMapping, mapping the domain part of a user principal name (or adomain\username) to a short domain name.
Methods
GetProfile(IIdentity)
Builds the profile of the identity from its claims.
public UserProfile GetProfile(IIdentity identity)
Parameters
identityIIdentityThe identity, which must be a ClaimsIdentity.
Returns
- UserProfile
The profile. The account name and the domain are extracted from the user principal name; the culture is the invariant culture when the culture claim is missing, falls back to
en-GBwhen the claim is not a valid culture name, and the security identifier toS-1-0-0when the sid claim is missing.
Exceptions
- ArgumentNullException
identityis null.- NotSupportedException
identityis not a ClaimsIdentity.