WebExtensionsGetAccountIdFromCookie Method
Generates account user from ClaimsPrincipal.
Note: the method assumes the user is logged in, and the cookies are present.
Therefore, use this method in a try-catching block and redirect the user to the login page if the cookies aren't present.
Namespace: MobileTrack.Web.Components.ExtensionsAssembly: MobileTrack.Web.Components (in MobileTrack.Web.Components.dll) Version: 0.7+ce90b2cf6b782b8d7b7fd47b3c546987c652c00f
public static void GetAccountIdFromCookie(
this ClaimsPrincipal principal,
out Guid accountId,
out Guid companyId
)
- principal ClaimsPrincipal
- ClaimsPrincipal to convert.
- accountId Guid
- Found Account ID in the cookie
- companyId Guid
- Found Company ID in the cookie
Account based on the ClaimsIdentity of the Principal.In Visual Basic and C#, you can call this method as an instance method on any object of type
ClaimsPrincipal. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).