ClaimsPrincipalExtensions.GetObjectId(ClaimsPrincipal) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the unique object ID associated with the ClaimsPrincipal.
public static string? GetObjectId (this System.Security.Claims.ClaimsPrincipal claimsPrincipal);
static member GetObjectId : System.Security.Claims.ClaimsPrincipal -> string
<Extension()>
Public Function GetObjectId (claimsPrincipal As ClaimsPrincipal) As String
Parameters
- claimsPrincipal
- ClaimsPrincipal
The ClaimsPrincipal from which to retrieve the unique object ID.
Returns
Unique object ID of the identity, or null
if it cannot be found.
Remarks
This method returns the object ID both in case the developer has enabled or not claims mapping.