Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
GenericIdentity.cs
Go to the documentation of this file.
3
5
7{
8 private readonly string m_name;
9
10 private readonly string m_type;
11
12 public override IEnumerable<Claim> Claims => base.Claims;
13
14 public override string Name => m_name;
15
16 public override string AuthenticationType => m_type;
17
18 public override bool IsAuthenticated => !m_name.Equals("");
19
20 public GenericIdentity(string name)
21 {
22 if (name == null)
23 {
24 throw new ArgumentNullException("name");
25 }
26 m_name = name;
27 m_type = "";
29 }
30
31 public GenericIdentity(string name, string type)
32 {
33 if (name == null)
34 {
35 throw new ArgumentNullException("name");
36 }
37 if (type == null)
38 {
39 throw new ArgumentNullException("type");
40 }
41 m_name = name;
42 m_type = type;
44 }
45
46 protected GenericIdentity(GenericIdentity identity)
47 : base(identity)
48 {
49 m_name = identity.m_name;
50 m_type = identity.m_type;
51 }
52
53 public override ClaimsIdentity Clone()
54 {
55 return new GenericIdentity(this);
56 }
57
58 private void AddNameClaim()
59 {
60 if (m_name != null)
61 {
62 base.AddClaim(new Claim(base.NameClaimType, m_name, "http://www.w3.org/2001/XMLSchema#string", "LOCAL AUTHORITY", "LOCAL AUTHORITY", this));
63 }
64 }
65}
GenericIdentity(GenericIdentity identity)
GenericIdentity(string name, string type)