-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathClaimsIdentitySurrogate.cs
More file actions
33 lines (26 loc) · 943 Bytes
/
ClaimsIdentitySurrogate.cs
File metadata and controls
33 lines (26 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System.Collections.Generic;
using System.Security.Claims;
using Orleans;
namespace ManagedCode.Orleans.Identity.Core.Serializations;
// This is the surrogate which will act as a stand-in for the foreign type.
// Surrogates should use plain fields instead of properties for better performance.
[GenerateSerializer]
public struct ClaimsIdentitySurrogate
{
public ClaimsIdentitySurrogate(List<Claim>? claims, string? authenticationType, string? nameType, string? roleType)
{
AuthenticationType = authenticationType;
Claims = claims;
RoleType = roleType;
NameType = nameType;
}
[Id(0)]
public string? AuthenticationType { get; set; }
[Id(1)]
public List<Claim>? Claims { get; set; }
[Id(2)]
public string? RoleType { get; set; }
[Id(3)]
public string? NameType { get; set; }
}
// This is a converter which converts between the surrogate and the foreign type.