C# Class System.Security.Claims.ClaimsPrincipalExtensions

Show file Open project: Azure-Samples/guidance-identity-management-for-multitenant-apps

Public Methods

Method Description
FindFirstValue ( this principal, string claimType, bool throwIfNotFound = false ) : string
GetDisplayNameValue ( this principal ) : string
GetEmailValue ( this principal ) : string
GetIssuerValue ( this principal, bool throwIfNotFound = true ) : string
GetObjectIdentifierValue ( this principal, bool throwIfNotFound = true ) : string
GetSurveyTenantIdValue ( this principal ) : int
GetSurveyUserIdValue ( this principal ) : int
GetTenantIdValue ( this principal ) : string

Extension method on System.Security.Claims.ClaimsPrincipal which returns the AAD Tenant ID, if it exists.

GetUserName ( this principal ) : string
IsSignedInToApplication ( this principal ) : bool

Method Details

FindFirstValue() public static method

public static FindFirstValue ( this principal, string claimType, bool throwIfNotFound = false ) : string
principal this
claimType string
throwIfNotFound bool
return string

GetDisplayNameValue() public static method

public static GetDisplayNameValue ( this principal ) : string
principal this
return string

GetEmailValue() public static method

public static GetEmailValue ( this principal ) : string
principal this
return string

GetIssuerValue() public static method

public static GetIssuerValue ( this principal, bool throwIfNotFound = true ) : string
principal this
throwIfNotFound bool
return string

GetObjectIdentifierValue() public static method

public static GetObjectIdentifierValue ( this principal, bool throwIfNotFound = true ) : string
principal this
throwIfNotFound bool
return string

GetSurveyTenantIdValue() public static method

public static GetSurveyTenantIdValue ( this principal ) : int
principal this
return int

GetSurveyUserIdValue() public static method

public static GetSurveyUserIdValue ( this principal ) : int
principal this
return int

GetTenantIdValue() public static method

Extension method on System.Security.Claims.ClaimsPrincipal which returns the AAD Tenant ID, if it exists.
public static GetTenantIdValue ( this principal ) : string
principal this A representing the currently signed in ASP.NET user.
return string

GetUserName() public static method

public static GetUserName ( this principal ) : string
principal this
return string

IsSignedInToApplication() public static method

public static IsSignedInToApplication ( this principal ) : bool
principal this
return bool