IdentityExtensions Class

 

Provides extension methods to get the user name or user ID from an identity.

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

Inheritance Hierarchy

System.Object
  Microsoft.AspNet.Identity.IdentityExtensions

Syntax

public static class IdentityExtensions
[ExtensionAttribute]
public ref class IdentityExtensions abstract sealed 
[<AbstractClass>]
[<Sealed>]
type IdentityExtensions = class end
<ExtensionAttribute>
Public NotInheritable Class IdentityExtensions

Methods

Name Description
System_CAPS_pubmethodSystem_CAPS_static FindFirstValue(ClaimsIdentity, String)

Returns the claim value for the first claim with the specified type.

System_CAPS_pubmethodSystem_CAPS_static GetUserId(IIdentity)

Returns the user ID using the UserIdClaimType.

System_CAPS_pubmethodSystem_CAPS_static GetUserId<T>(IIdentity)

Return the user id using the UserIdClaimType

System_CAPS_pubmethodSystem_CAPS_static GetUserName(IIdentity)

Returns the user name using the UserNameClaimType.

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

Microsoft.AspNet.Identity Namespace
ASP.NET Identity

Return to top