Class ClaimsPrincipalExtensions
Extension methods for System.Security.Claims.ClaimsPrincipal and related types.
Inheritance
object
Namespace: Umbraco.Extensions
Assembly: Umbraco.Core.dll
Syntax
public static class ClaimsPrincipalExtensions
Methods
View SourceGetRemainingAuthSeconds(IPrincipal)
Returns the remaining seconds on an auth ticket for the user based on the claim applied to the user durnig authentication
Declaration
public static double GetRemainingAuthSeconds(this IPrincipal user)
Parameters
| Type | Name | Description |
|---|---|---|
| IPrincipal | user |
Returns
| Type | Description |
|---|---|
| double |
GetRemainingAuthSeconds(IPrincipal, DateTimeOffset)
Returns the remaining seconds on an auth ticket for the user based on the claim applied to the user durnig authentication
Declaration
public static double GetRemainingAuthSeconds(this IPrincipal user, DateTimeOffset now)
Parameters
| Type | Name | Description |
|---|---|---|
| IPrincipal | user | |
| DateTimeOffset | now |
Returns
| Type | Description |
|---|---|
| double |
GetUmbracoIdentity(IPrincipal)
This will return the current back office identity if the IPrincipal is the correct type and authenticated.
Declaration
public static ClaimsIdentity? GetUmbracoIdentity(this IPrincipal principal)
Parameters
| Type | Name | Description |
|---|---|---|
| IPrincipal | principal |
Returns
| Type | Description |
|---|---|
| ClaimsIdentity |
IsBackOfficeAuthenticationType(ClaimsIdentity?)
Determines whether the specified claims identity is a back office authentication type.
Declaration
public static bool IsBackOfficeAuthenticationType(this ClaimsIdentity? claimsIdentity)
Parameters
| Type | Name | Description |
|---|---|---|
| ClaimsIdentity | claimsIdentity | The claims identity to check. |
Returns
| Type | Description |
|---|---|
| bool |
|