IdentityExtensions Class

Extensions making it easier to get the user name/user id claims off of an identity.

Inheritance Hierarchy

System.Object
  Microsoft.AspNet.Identity.IdentityExtensions

Namespace:  Microsoft.AspNet.Identity
Assembly:  Microsoft.AspNet.Identity.Core (in Microsoft.AspNet.Identity.Core.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public NotInheritable Class IdentityExtensions
'Usage
public static class IdentityExtensions
[ExtensionAttribute]
public ref class IdentityExtensions abstract sealed
[<AbstractClassAttribute>]
[<SealedAttribute>]
type IdentityExtensions =  class end
public final class IdentityExtensions

The IdentityExtensions type exposes the following members.

Methods

  Name Description
Public methodStatic member FindFirstValue Return the claim value for the first claim with the specified type if it exists, null otherwise.
Public methodStatic member GetUserId Return the user id using the UserIdClaimType.
Public methodStatic member GetUserName Return the user name using the UserNameClaimType.

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.AspNet.Identity Namespace