ClaimUtils
Assembly: ServiceStack.Blazor.dll
View Source
Declaration
public static class ClaimUtils
Fields
AuthenticationType
View Source
Declaration
public const string AuthenticationType = "Server Authentication"
PermissionType
View Source
Declaration
public const string PermissionType = "perm"
Picture
View Source
Declaration
public const string Picture = "picture"
Admin
View Source
Declaration
public const string Admin = "Admin"
Methods
IsAuthenticated(Nullable<AuthenticationState>)
View Source
Declaration
public static bool IsAuthenticated(this AuthenticationState? state)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Nullable<AuthenticationState> | state |
AuthenticatedUser(Nullable<AuthenticationState>)
View Source
Declaration
public static ClaimsPrincipal AuthenticatedUser(this AuthenticationState? state)
Returns
System.Security.Claims.ClaimsPrincipal
Parameters
Type | Name |
---|---|
System.Nullable<AuthenticationState> | state |
AuthenticatedUser(ClaimsPrincipal)
View Source
Declaration
public static ClaimsPrincipal AuthenticatedUser(this ClaimsPrincipal principal)
Returns
System.Security.Claims.ClaimsPrincipal
Parameters
Type | Name |
---|---|
System.Security.Claims.ClaimsPrincipal | principal |
IsAdmin(ClaimsPrincipal)
View Source
Declaration
public static bool IsAdmin(this ClaimsPrincipal principal)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Security.Claims.ClaimsPrincipal | principal |
GetUserId(ClaimsPrincipal)
View Source
Declaration
public static string GetUserId(this ClaimsPrincipal principal)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Security.Claims.ClaimsPrincipal | principal |
GetDisplayName(ClaimsPrincipal)
View Source
Declaration
public static string GetDisplayName(this ClaimsPrincipal principal)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Security.Claims.ClaimsPrincipal | principal |
GetEmail(ClaimsPrincipal)
View Source
Declaration
public static string GetEmail(this ClaimsPrincipal principal)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Security.Claims.ClaimsPrincipal | principal |
GetRoles(ClaimsPrincipal)
View Source
Declaration
public static string[] GetRoles(this ClaimsPrincipal principal)
Returns
System.String[]
Parameters
Type | Name |
---|---|
System.Security.Claims.ClaimsPrincipal | principal |
GetPermissions(ClaimsPrincipal)
View Source
Declaration
public static string[] GetPermissions(this ClaimsPrincipal principal)
Returns
System.String[]
Parameters
Type | Name |
---|---|
System.Security.Claims.ClaimsPrincipal | principal |
HasRole(ClaimsPrincipal, String)
View Source
Declaration
public static bool HasRole(this ClaimsPrincipal principal, string roleName)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Security.Claims.ClaimsPrincipal | principal |
System.String | roleName |
HasAllRoles(ClaimsPrincipal, String[])
View Source
Declaration
public static bool HasAllRoles(this ClaimsPrincipal principal, params string[] roleNames)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Security.Claims.ClaimsPrincipal | principal |
System.String[] | roleNames |
GetProfileUrl(ClaimsPrincipal)
View Source
Declaration
public static string GetProfileUrl(this ClaimsPrincipal principal)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Security.Claims.ClaimsPrincipal | principal |