103 references to Resource
System.IdentityModel (46)
System\IdentityModel\Claims\ClaimComparer.cs (4)
146
return resourceComparer.Equals(claim1.
Resource
, claim2.
Resource
);
155
^ ( (claim.
Resource
== null) ? 0 : resourceComparer.GetHashCode(claim.
Resource
));
System\IdentityModel\Claims\ClaimsConversionHelper.cs (27)
35
if ((claim != null) && (claim.
Resource
is string))
37
issuer = claim.
Resource
as string;
83
if (wcfClaim.
Resource
== null)
93
if (wcfClaim.
Resource
is string)
116
claimValue = (string)claim.
Resource
;
139
if (StringComparer.Ordinal.Equals(claim.ClaimType, ClaimTypes.Sid) && claim.
Resource
is SecurityIdentifier)
149
_value = ((SecurityIdentifier)claim.
Resource
).Value;
151
else if (StringComparer.Ordinal.Equals(claim.ClaimType, ClaimTypes.Email) && claim.
Resource
is MailAddress)
154
_value = ((MailAddress)claim.
Resource
).Address;
156
else if (StringComparer.Ordinal.Equals(claim.ClaimType, ClaimTypes.Thumbprint) && claim.
Resource
is byte[])
159
_value = Convert.ToBase64String(((byte[])claim.
Resource
));
162
else if (StringComparer.Ordinal.Equals(claim.ClaimType, ClaimTypes.Hash) && claim.
Resource
is byte[])
165
_value = Convert.ToBase64String(((byte[])claim.
Resource
));
168
else if (StringComparer.Ordinal.Equals(claim.ClaimType, ClaimTypes.NameIdentifier) && claim.
Resource
is SamlNameIdentifierClaimResource)
171
_value = ((SamlNameIdentifierClaimResource)claim.
Resource
).Name;
173
if (((SamlNameIdentifierClaimResource)claim.
Resource
).Format != null)
176
samlNameIdentifierFormat = ((SamlNameIdentifierClaimResource)claim.
Resource
).Format;
178
if (((SamlNameIdentifierClaimResource)claim.
Resource
).NameQualifier != null)
180
samlNameIdentifierNameQualifier = ((SamlNameIdentifierClaimResource)claim.
Resource
).NameQualifier;
183
else if (StringComparer.Ordinal.Equals(claim.ClaimType, ClaimTypes.X500DistinguishedName) && claim.
Resource
is X500DistinguishedName)
186
_value = ((X500DistinguishedName)claim.
Resource
).Name;
189
else if (StringComparer.Ordinal.Equals(claim.ClaimType, ClaimTypes.Uri) && claim.
Resource
is Uri)
192
_value = ((Uri)claim.
Resource
).ToString();
194
else if (StringComparer.Ordinal.Equals(claim.ClaimType, ClaimTypes.Rsa) && claim.
Resource
is RSA)
197
_value = ((RSA)claim.
Resource
).ToXmlString(false);
200
else if (StringComparer.Ordinal.Equals(claim.ClaimType, ClaimTypes.DenyOnlySid) && claim.
Resource
is SecurityIdentifier)
203
_value = ((SecurityIdentifier)claim.
Resource
).Value;
System\IdentityModel\Tokens\SamlAttribute.cs (2)
61
if (!(claim.
Resource
is String))
80
this.attributeValues.Add(claim.
Resource
as string);
System\IdentityModel\Tokens\SamlSubject.cs (1)
242
this.identity = SecurityUtils.CreateIdentity(identityClaim.
Resource
.ToString(), this.GetType().Name);
System\IdentityModel\Tokens\SessionSecurityToken.cs (12)
1523
SerializeSid((SecurityIdentifier)claim.
Resource
, dictionary, writer);
1531
SerializeSid((SecurityIdentifier)claim.
Resource
, dictionary, writer);
1539
byte[] rawData = ((X500DistinguishedName)claim.
Resource
).RawData;
1548
byte[] thumbprint = (byte[])claim.
Resource
;
1557
writer.WriteString((string)claim.
Resource
);
1565
writer.WriteString((string)claim.
Resource
);
1573
writer.WriteString(((RSA)claim.
Resource
).ToXmlString(false));
1581
writer.WriteString(((System.Net.Mail.MailAddress)claim.
Resource
).Address);
1594
byte[] hash = (byte[])claim.
Resource
;
1603
writer.WriteString((string)claim.
Resource
);
1611
writer.WriteString((string)claim.
Resource
);
1619
writer.WriteString(((Uri)claim.
Resource
).AbsoluteUri);
System.ServiceModel (52)
System\ServiceModel\Channels\PeerSecurityHelpers.cs (1)
36
RSACryptoServiceProvider provider = claim.
Resource
as RSACryptoServiceProvider;
System\ServiceModel\Configuration\IdentityElement.cs (4)
97
this.Dns.Value = (string)claim.
Resource
;
101
this.ServicePrincipalName.Value = (string)claim.
Resource
;
105
this.UserPrincipalName.Value = (string)claim.
Resource
;
109
this.Rsa.Value = ((RSA)claim.
Resource
).ToXmlString(false);
System\ServiceModel\Diagnostics\PeerNodeTraceRecord.cs (3)
242
writer.WriteElementString("Name", claim.
Resource
.ToString());
245
writer.WriteElementString("X500DistinguishedName", (claim.
Resource
as X500DistinguishedName).Name.ToString());
249
writer.WriteElementString("Thumbprint", Convert.ToBase64String(claim.
Resource
as byte[]));
System\ServiceModel\Diagnostics\SecurityTraceRecordHelper.cs (4)
610
if (claim.
Resource
!= null)
611
xml.WriteElementString("ResourceType", claim.
Resource
.GetType().ToString());
1132
if (claim.
Resource
!= null)
1133
xml.WriteElementString("ResourceType", claim.
Resource
.GetType().ToString());
System\ServiceModel\DnsEndpointIdentity.cs (1)
41
writer.WriteElementString(XD.AddressingDictionary.Dns, XD.AddressingDictionary.IdentityExtensionNamespace, (string)this.IdentityClaim.
Resource
);
System\ServiceModel\RsaEndpointIdentity.cs (1)
73
RSA rsa = (RSA)this.IdentityClaim.
Resource
;
System\ServiceModel\Security\IdentityModelServiceAuthorizationManager.cs (4)
744
return StringComparer.OrdinalIgnoreCase.Equals(claim1.
Resource
, claim2.
Resource
);
755
^ ((claim.
Resource
== null) ? 0 : claim.
Resource
.GetHashCode());
System\ServiceModel\Security\IdentityVerifier.cs (11)
128
&& identity.IdentityClaim.
Resource
is string)
130
string expectedDnsName = (string)identity.IdentityClaim.
Resource
;
137
if (claim.
Resource
is string)
139
actualDnsName = (string)claim.
Resource
;
230
if (claim.
Resource
is WindowsIdentity)
231
return ((WindowsIdentity)claim.
Resource
).User;
232
else if (claim.
Resource
is WindowsSidIdentity)
233
return ((WindowsSidIdentity)claim.
Resource
).SecurityIdentifier;
234
return claim.
Resource
as SecurityIdentifier;
243
if (expectedSpn.Equals((string)claim.
Resource
, StringComparison.OrdinalIgnoreCase))
296
expectedSpn = string.Format(CultureInfo.InvariantCulture, "host/{0}", (string)identity.IdentityClaim.
Resource
);
System\ServiceModel\Security\SctClaimSerializer.cs (12)
69
SerializeSid((SecurityIdentifier)claim.
Resource
, dictionary, writer);
77
SerializeSid((SecurityIdentifier)claim.
Resource
, dictionary, writer);
85
byte[] rawData = ((X500DistinguishedName)claim.
Resource
).RawData;
94
byte[] thumbprint = (byte[])claim.
Resource
;
103
writer.WriteString((string)claim.
Resource
);
111
writer.WriteString((string)claim.
Resource
);
119
writer.WriteString(((RSA)claim.
Resource
).ToXmlString(false));
127
writer.WriteString(((MailAddress)claim.
Resource
).Address);
140
byte[] hash = (byte[])claim.
Resource
;
149
writer.WriteString((string)claim.
Resource
);
157
writer.WriteString((string)claim.
Resource
);
165
writer.WriteString(((Uri)claim.
Resource
).AbsoluteUri);
System\ServiceModel\Security\SecurityUtils.cs (3)
735
spn = (string)identity.IdentityClaim.
Resource
;
740
spn = (string)identity.IdentityClaim.
Resource
;
745
spn = String.Format(CultureInfo.InvariantCulture, "host/{0}", (string)identity.IdentityClaim.
Resource
);
System\ServiceModel\Security\SimpleSecurityTokenProvider.cs (1)
105
policies.Add(new UnconditionalPolicy(SecurityUtils.CreateIdentity(endpointIdentity.IdentityClaim.
Resource
.ToString()),
System\ServiceModel\Security\SpnegoTokenProvider.cs (1)
242
spn = identityClaim.
Resource
.ToString();
System\ServiceModel\Security\Tokens\IssuedSecurityTokenProvider.cs (1)
942
policies.Add(new UnconditionalPolicy(SecurityUtils.CreateIdentity(identity.IdentityClaim.
Resource
.ToString()),
System\ServiceModel\SpnEndpointIdentity.cs (3)
76
writer.WriteElementString(XD.AddressingDictionary.Spn, XD.AddressingDictionary.IdentityExtensionNamespace, (string)this.IdentityClaim.
Resource
);
94
spn = "host/" + (string)this.IdentityClaim.
Resource
;
98
spn = (string)this.IdentityClaim.
Resource
;
System\ServiceModel\UpnEndpointIdentity.cs (2)
174
writer.WriteElementString(XD.AddressingDictionary.Upn, XD.AddressingDictionary.IdentityExtensionNamespace, (string)this.IdentityClaim.
Resource
);
184
string upn = (string)this.IdentityClaim.
Resource
;
System.ServiceModel.Activities (5)
System\ServiceModel\XamlIntegration\EndpointIdentityExtension.cs (1)
31
this.ClaimResource = identity.IdentityClaim.
Resource
;
System\ServiceModel\XamlIntegration\SpnEndpointIdentityExtension.cs (2)
27
Fx.Assert(identity.IdentityClaim.
Resource
is string, "SpnEndpointIdentity claim resource is not string");
28
this.SpnName = (string)identity.IdentityClaim.
Resource
;
System\ServiceModel\XamlIntegration\UpnEndpointIdentityExtension.cs (2)
27
Fx.Assert(identity.IdentityClaim.
Resource
is string, "UpnEndpointIdentity claim resource is not string");
28
this.UpnName = (string)identity.IdentityClaim.
Resource
;