IdentityExtensions Class

Namespace:
Weavy.Core.Helpers
Assembly:
Weavy.Core.dll

Extensions making it easier to get claims off of an identity.

public static class IdentityExtensions
Inheritance:
System.Object → IdentityExtensions

Fields

AUTHENTICATION_TYPE Name of the authentication type claim

Methods

Get(ClaimsIdentity, String[]) Get the first claim with any of the specified type(s), otherwise null.
GetEmail(ClaimsIdentity) Get the email if it exists, otherwise null.
GetId(ClaimsIdentity) Get the user id if it exists, otherwise null.
GetIdClaim(ClaimsIdentity) Get the user id claim if it exists, otherwise null.
GetName(ClaimsIdentity) Get the display name if it exists, otherwise null.
GetUsername(ClaimsIdentity) Get the username if it exists, otherwise null.