Class MergeClaimsIdentityExtensions
Contains extension methods for merging System.Security.Claims.ClaimsIdentity instances.
Inheritance
Namespace: Umbraco.Extensions
Assembly: Umbraco.Infrastructure.dll
Syntax
public static class MergeClaimsIdentityExtensions
Methods
View SourceMergeAllClaims(ClaimsIdentity, ClaimsIdentity)
Merges all claims from the source System.Security.Claims.ClaimsIdentity into the destination System.Security.Claims.ClaimsIdentity, adding only those claims that do not already exist in the destination.
Declaration
public static void MergeAllClaims(this ClaimsIdentity destination, ClaimsIdentity source)
Parameters
| Type | Name | Description |
|---|---|---|
| ClaimsIdentity | destination | The System.Security.Claims.ClaimsIdentity to which claims will be added. |
| ClaimsIdentity | source | The System.Security.Claims.ClaimsIdentity from which claims will be copied. |
MergeClaimsFromBackOfficeIdentity(ClaimsIdentity, BackOfficeIdentityUser)
Adds claims from a BackOfficeIdentityUser to the specified System.Security.Claims.ClaimsIdentity, excluding any claims whose types are in the ignored claims list and skipping claims that already exist in the destination.
Declaration
public static void MergeClaimsFromBackOfficeIdentity(this ClaimsIdentity destination, BackOfficeIdentityUser source)
Parameters
| Type | Name | Description |
|---|---|---|
| ClaimsIdentity | destination | The System.Security.Claims.ClaimsIdentity to which new claims will be added. |
| BackOfficeIdentityUser | source | The BackOfficeIdentityUser whose claims will be merged into the destination identity. |
Remarks
Claims are only added if their type is not in the ignored claims list and if an identical claim does not already exist in the destination.
MergeClaimsFromCookieIdentity(ClaimsIdentity, ClaimsIdentity)
Merges claims from the source System.Security.Claims.ClaimsIdentity into the destination System.Security.Claims.ClaimsIdentity.
Only claims that are not present in the destination and are not in the ignored claims list are added.
Declaration
public static void MergeClaimsFromCookieIdentity(this ClaimsIdentity destination, ClaimsIdentity source)
Parameters
| Type | Name | Description |
|---|---|---|
| ClaimsIdentity | destination | The System.Security.Claims.ClaimsIdentity to which new claims will be added. |
| ClaimsIdentity | source | The System.Security.Claims.ClaimsIdentity from which claims will be merged. |