Class ClaimsAuthorizationFiller
An IClaimAuthorizationFiller that reads the Authorization claim of a ClaimsIdentity and deserializes it into an Authorization.
[Export(typeof(IClaimAuthorizationFiller))]
[Shared]
public class ClaimsAuthorizationFiller : IClaimAuthorizationFiller, IAuthorizationFiller
- Inheritance
-
ClaimsAuthorizationFiller
- Implements
- Inherited Members
Constructors
ClaimsAuthorizationFiller(ILogger<ClaimsAuthorizationFiller>)
An IClaimAuthorizationFiller that reads the Authorization claim of a ClaimsIdentity and deserializes it into an Authorization.
public ClaimsAuthorizationFiller(ILogger<ClaimsAuthorizationFiller> logger)
Parameters
loggerILogger<ClaimsAuthorizationFiller>The logger used to trace a claim that cannot be deserialized.
Methods
GetAuthorization(IIdentity)
Gets the authorization data of the identity.
public Authorization GetAuthorization(IIdentity identity)
Parameters
identityIIdentityThe identity, which must be a ClaimsIdentity.
Returns
- Authorization
The authorization contained in the authorization claim, or an empty Authorization when the claim is missing or cannot be deserialized.
Exceptions
- ArgumentNullException
identityis null.- NotSupportedException
identityis not a ClaimsIdentity.