251 references to SamlConstants
System.IdentityModel (251)
System\IdentityModel\Claims\AuthenticationTypeMaps.cs (12)
30
new Mapping( AuthenticationMethods.HardwareToken,
SamlConstants
.AuthenticationMethods.HardwareTokenString ),
31
new Mapping( AuthenticationMethods.Kerberos,
SamlConstants
.AuthenticationMethods.KerberosString ),
32
new Mapping( AuthenticationMethods.Password,
SamlConstants
.AuthenticationMethods.PasswordString ),
33
new Mapping( AuthenticationMethods.Pgp,
SamlConstants
.AuthenticationMethods.PgpString ),
34
new Mapping( AuthenticationMethods.SecureRemotePassword,
SamlConstants
.AuthenticationMethods.SecureRemotePasswordString ),
35
new Mapping( AuthenticationMethods.Signature,
SamlConstants
.AuthenticationMethods.SignatureString ),
36
new Mapping( AuthenticationMethods.Spki,
SamlConstants
.AuthenticationMethods.SpkiString ),
37
new Mapping( AuthenticationMethods.TlsClient,
SamlConstants
.AuthenticationMethods.TlsClientString ),
38
new Mapping( AuthenticationMethods.Unspecified,
SamlConstants
.AuthenticationMethods.UnspecifiedString ),
39
new Mapping( AuthenticationMethods.Windows,
SamlConstants
.AuthenticationMethods.WindowsString ),
40
new Mapping( AuthenticationMethods.X509,
SamlConstants
.AuthenticationMethods.X509String ),
41
new Mapping( AuthenticationMethods.Xkms,
SamlConstants
.AuthenticationMethods.XkmsString ),
System\IdentityModel\Tokens\SamlAssertion.cs (11)
23
string assertionId =
SamlConstants
.AssertionIdPrefix + Guid.NewGuid().ToString();
91
get { return
SamlConstants
.MinorVersionValue; }
96
get { return
SamlConstants
.MajorVersionValue; }
511
if ((majorVersion !=
SamlConstants
.MajorVersionValue) || (minorVersion !=
SamlConstants
.MinorVersionValue))
513
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenException(SR.GetString(SR.SAMLTokenVersionNotSupported, majorVersion, minorVersion,
SamlConstants
.MajorVersionValue,
SamlConstants
.MinorVersionValue)));
533
attributeValue,
SamlConstants
.AcceptedDateTimeFormats, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None).ToUniversalTime();
633
writer.WriteValue(
SamlConstants
.MajorVersionValue);
636
writer.WriteValue(
SamlConstants
.MinorVersionValue);
645
writer.WriteString(this.issueInstant.ToString(
SamlConstants
.GeneratedDateTimeFormat, CultureInfo.InvariantCulture));
System\IdentityModel\Tokens\SamlAuthenticationStatement.cs (2)
180
authInstance,
SamlConstants
.AcceptedDateTimeFormats, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None).ToUniversalTime();
257
writer.WriteString(this.authenticationInstant.ToString(
SamlConstants
.GeneratedDateTimeFormat, CultureInfo.InvariantCulture));
System\IdentityModel\Tokens\SamlConditions.cs (4)
116
time,
SamlConstants
.AcceptedDateTimeFormats, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None).ToUniversalTime();
121
time,
SamlConstants
.AcceptedDateTimeFormats, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None).ToUniversalTime();
163
writer.WriteString(this.notBefore.ToString(
SamlConstants
.GeneratedDateTimeFormat, DateTimeFormatInfo.InvariantInfo));
170
writer.WriteString(this.notOnOrAfter.ToString(
SamlConstants
.GeneratedDateTimeFormat, DateTimeFormatInfo.InvariantInfo));
System\IdentityModel\Tokens\SamlSecurityTokenHandler.cs (222)
605
samlSubject.ConfirmationMethods.Add(
SamlConstants
.HolderOfKey);
1151
/// <returns><see cref="
SamlConstants
.AuthenticationMethods"/></returns>
1160
/// <param name="saml11AuthenticationMethod"><see cref="
SamlConstants
.AuthenticationMethods"/></param>
1258
else if (StringComparer.Ordinal.Equals(attr.Name,
SamlConstants
.ElementNames.NameIdentifier))
1522
return reader.IsStartElement(
SamlConstants
.ElementNames.Assertion,
SamlConstants
.Namespace);
1571
if (reader.IsStartElement(
SamlConstants
.ElementNames.Action,
SamlConstants
.Namespace))
1574
string ns = reader.GetAttribute(
SamlConstants
.AttributeNames.Namespace, null);
1590
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4065,
SamlConstants
.ElementNames.Action,
SamlConstants
.Namespace, reader.LocalName, reader.NamespaceURI)));
1612
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.Action,
SamlConstants
.Namespace);
1615
writer.WriteAttributeString(
SamlConstants
.AttributeNames.Namespace, null, action.Namespace);
1635
if (!reader.IsStartElement(
SamlConstants
.ElementNames.Advice,
SamlConstants
.Namespace))
1637
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4065,
SamlConstants
.ElementNames.Advice,
SamlConstants
.Namespace, reader.LocalName, reader.NamespaceURI)));
1657
if (reader.IsStartElement(
SamlConstants
.ElementNames.AssertionIdReference,
SamlConstants
.Namespace))
1662
else if (reader.IsStartElement(
SamlConstants
.ElementNames.Assertion,
SamlConstants
.Namespace))
1700
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.Advice,
SamlConstants
.Namespace);
1709
writer.WriteElementString(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.AssertionIdReference,
SamlConstants
.Namespace, assertionIdReference);
1754
if (!wrappedReader.IsStartElement(
SamlConstants
.ElementNames.Assertion,
SamlConstants
.Namespace))
1756
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4065,
SamlConstants
.ElementNames.Assertion,
SamlConstants
.Namespace, wrappedReader.LocalName, wrappedReader.NamespaceURI)));
1759
string attributeValue = wrappedReader.GetAttribute(
SamlConstants
.AttributeNames.MajorVersion, null);
1762
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4075,
SamlConstants
.AttributeNames.MajorVersion)));
1767
attributeValue = wrappedReader.GetAttribute(
SamlConstants
.AttributeNames.MinorVersion, null);
1770
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4075,
SamlConstants
.AttributeNames.MinorVersion)));
1775
if ((majorVersion !=
SamlConstants
.MajorVersionValue) || (minorVersion !=
SamlConstants
.MinorVersionValue))
1777
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4076, majorVersion, minorVersion,
SamlConstants
.MajorVersionValue,
SamlConstants
.MinorVersionValue)));
1780
attributeValue = wrappedReader.GetAttribute(
SamlConstants
.AttributeNames.AssertionId, null);
1783
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4075,
SamlConstants
.AttributeNames.AssertionId)));
1793
attributeValue = wrappedReader.GetAttribute(
SamlConstants
.AttributeNames.Issuer, null);
1796
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4075,
SamlConstants
.AttributeNames.Issuer)));
1801
attributeValue = wrappedReader.GetAttribute(
SamlConstants
.AttributeNames.IssueInstant, null);
1811
if (wrappedReader.IsStartElement(
SamlConstants
.ElementNames.Conditions,
SamlConstants
.Namespace))
1816
if (wrappedReader.IsStartElement(
SamlConstants
.ElementNames.Advice,
SamlConstants
.Namespace))
1877
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.Assertion,
SamlConstants
.Namespace);
1879
writer.WriteAttributeString(
SamlConstants
.AttributeNames.MajorVersion, null, Convert.ToString(
SamlConstants
.MajorVersionValue, CultureInfo.InvariantCulture));
1880
writer.WriteAttributeString(
SamlConstants
.AttributeNames.MinorVersion, null, Convert.ToString(
SamlConstants
.MinorVersionValue, CultureInfo.InvariantCulture));
1881
writer.WriteAttributeString(
SamlConstants
.AttributeNames.AssertionId, null, assertion.AssertionId);
1882
writer.WriteAttributeString(
SamlConstants
.AttributeNames.Issuer, null, assertion.Issuer);
1883
writer.WriteAttributeString(
SamlConstants
.AttributeNames.IssueInstant, null, assertion.IssueInstant.ToUniversalTime().ToString(DateTimeFormats.Generated, CultureInfo.InvariantCulture));
1922
string time = reader.GetAttribute(
SamlConstants
.AttributeNames.NotBefore, null);
1929
time = reader.GetAttribute(
SamlConstants
.AttributeNames.NotOnOrAfter, null);
1977
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.Conditions,
SamlConstants
.Namespace);
1987
SamlConstants
.AttributeNames.NotBefore,
1996
SamlConstants
.AttributeNames.NotOnOrAfter,
2023
if (reader.IsStartElement(
SamlConstants
.ElementNames.AudienceRestrictionCondition,
SamlConstants
.Namespace))
2027
else if (reader.IsStartElement(
SamlConstants
.ElementNames.DoNotCacheCondition,
SamlConstants
.Namespace))
2083
if (!reader.IsStartElement(
SamlConstants
.ElementNames.AudienceRestrictionCondition,
SamlConstants
.Namespace))
2085
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4082,
SamlConstants
.ElementNames.AudienceRestrictionCondition,
SamlConstants
.Namespace, reader.LocalName, reader.NamespaceURI)));
2093
if (reader.IsStartElement(
SamlConstants
.ElementNames.Audience,
SamlConstants
.Namespace))
2107
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4082,
SamlConstants
.ElementNames.Audience,
SamlConstants
.Namespace, reader.LocalName, reader.NamespaceURI)));
2147
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.AudienceRestrictionCondition,
SamlConstants
.Namespace);
2152
writer.WriteElementString(
SamlConstants
.ElementNames.Audience,
SamlConstants
.Namespace, condition.Audiences[i].OriginalString);
2172
if (!reader.IsStartElement(
SamlConstants
.ElementNames.DoNotCacheCondition,
SamlConstants
.Namespace))
2174
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4082,
SamlConstants
.ElementNames.DoNotCacheCondition,
SamlConstants
.Namespace, reader.LocalName, reader.NamespaceURI)));
2212
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.DoNotCacheCondition,
SamlConstants
.Namespace);
2231
if (reader.IsStartElement(
SamlConstants
.ElementNames.AuthenticationStatement,
SamlConstants
.Namespace))
2235
else if (reader.IsStartElement(
SamlConstants
.ElementNames.AttributeStatement,
SamlConstants
.Namespace))
2239
else if (reader.IsStartElement(
SamlConstants
.ElementNames.AuthorizationDecisionStatement,
SamlConstants
.Namespace))
2308
if (!reader.IsStartElement(
SamlConstants
.ElementNames.Subject,
SamlConstants
.Namespace))
2310
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4082,
SamlConstants
.ElementNames.Subject,
SamlConstants
.Namespace, reader.LocalName, reader.NamespaceURI)));
2315
reader.ReadStartElement(
SamlConstants
.ElementNames.Subject,
SamlConstants
.Namespace);
2316
if (reader.IsStartElement(
SamlConstants
.ElementNames.NameIdentifier,
SamlConstants
.Namespace))
2318
subject.NameFormat = reader.GetAttribute(
SamlConstants
.AttributeNames.NameIdentifierFormat, null);
2319
subject.NameQualifier = reader.GetAttribute(
SamlConstants
.AttributeNames.NameIdentifierNameQualifier, null);
2330
if (reader.IsStartElement(
SamlConstants
.ElementNames.SubjectConfirmation,
SamlConstants
.Namespace))
2334
while (reader.IsStartElement(
SamlConstants
.ElementNames.SubjectConfirmationMethod,
SamlConstants
.Namespace))
2352
if (reader.IsStartElement(
SamlConstants
.ElementNames.SubjectConfirmationData,
SamlConstants
.Namespace))
2407
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.Subject,
SamlConstants
.Namespace);
2410
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.NameIdentifier,
SamlConstants
.Namespace);
2413
writer.WriteAttributeString(
SamlConstants
.AttributeNames.NameIdentifierFormat, null, subject.NameFormat);
2417
writer.WriteAttributeString(
SamlConstants
.AttributeNames.NameIdentifierNameQualifier, null, subject.NameQualifier);
2425
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.SubjectConfirmation,
SamlConstants
.Namespace);
2429
writer.WriteElementString(
SamlConstants
.ElementNames.SubjectConfirmationMethod,
SamlConstants
.Namespace, method);
2434
writer.WriteElementString(
SamlConstants
.ElementNames.SubjectConfirmationData,
SamlConstants
.Namespace, subject.SubjectConfirmationData);
2512
if (!reader.IsStartElement(
SamlConstants
.ElementNames.AttributeStatement,
SamlConstants
.Namespace))
2514
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4082,
SamlConstants
.ElementNames.AttributeStatement,
SamlConstants
.Namespace, reader.LocalName, reader.NamespaceURI)));
2520
if (reader.IsStartElement(
SamlConstants
.ElementNames.Subject,
SamlConstants
.Namespace))
2532
if (reader.IsStartElement(
SamlConstants
.ElementNames.Attribute,
SamlConstants
.Namespace))
2574
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.AttributeStatement,
SamlConstants
.Namespace);
2602
attribute.Name = reader.GetAttribute(
SamlConstants
.AttributeNames.AttributeName, null);
2608
attribute.Namespace = reader.GetAttribute(
SamlConstants
.AttributeNames.AttributeNamespace, null);
2620
string originalIssuer = reader.GetAttribute(
SamlConstants
.AttributeNames.OriginalIssuer, ClaimType2009Namespace);
2624
originalIssuer = reader.GetAttribute(
SamlConstants
.AttributeNames.OriginalIssuer, ProductConstants.NamespaceUri);
2635
while (reader.IsStartElement(
SamlConstants
.ElementNames.AttributeValue,
SamlConstants
.Namespace))
2730
reader.ReadStartElement(Saml2Constants.Elements.AttributeValue,
SamlConstants
.Namespace);
2775
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.Attribute,
SamlConstants
.Namespace);
2777
writer.WriteAttributeString(
SamlConstants
.AttributeNames.AttributeName, null, attribute.Name);
2778
writer.WriteAttributeString(
SamlConstants
.AttributeNames.AttributeNamespace, null, attribute.Namespace);
2783
writer.WriteAttributeString(
SamlConstants
.AttributeNames.OriginalIssuer, ClaimType2009Namespace, SamlAttribute.OriginalIssuer);
2804
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.AttributeValue,
SamlConstants
.Namespace);
2850
if (!reader.IsStartElement(
SamlConstants
.ElementNames.AuthenticationStatement,
SamlConstants
.Namespace))
2852
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4082,
SamlConstants
.ElementNames.AuthenticationStatement,
SamlConstants
.Namespace, reader.LocalName, reader.NamespaceURI)));
2856
string authInstance = reader.GetAttribute(
SamlConstants
.AttributeNames.AuthenticationInstant, null);
2864
authnStatement.AuthenticationMethod = reader.GetAttribute(
SamlConstants
.AttributeNames.AuthenticationMethod, null);
2873
if (reader.IsStartElement(
SamlConstants
.ElementNames.Subject,
SamlConstants
.Namespace))
2883
if (reader.IsStartElement(
SamlConstants
.ElementNames.SubjectLocality,
SamlConstants
.Namespace))
2885
authnStatement.DnsAddress = reader.GetAttribute(
SamlConstants
.AttributeNames.SubjectLocalityDNSAddress, null);
2886
authnStatement.IPAddress = reader.GetAttribute(
SamlConstants
.AttributeNames.SubjectLocalityIPAddress, null);
2903
if (reader.IsStartElement(
SamlConstants
.ElementNames.AuthorityBinding,
SamlConstants
.Namespace))
2910
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4082,
SamlConstants
.ElementNames.AuthorityBinding,
SamlConstants
.Namespace, reader.LocalName, reader.NamespaceURI)));
2938
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.AuthenticationStatement,
SamlConstants
.Namespace);
2940
writer.WriteAttributeString(
SamlConstants
.AttributeNames.AuthenticationMethod, null, statement.AuthenticationMethod);
2942
writer.WriteAttributeString(
SamlConstants
.AttributeNames.AuthenticationInstant, null,
2950
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.SubjectLocality,
SamlConstants
.Namespace);
2954
writer.WriteAttributeString(
SamlConstants
.AttributeNames.SubjectLocalityIPAddress, null, statement.IPAddress);
2959
writer.WriteAttributeString(
SamlConstants
.AttributeNames.SubjectLocalityDNSAddress, null, statement.DnsAddress);
2989
string authKind = reader.GetAttribute(
SamlConstants
.AttributeNames.AuthorityKind, null);
3019
authorityBinding.Binding = reader.GetAttribute(
SamlConstants
.AttributeNames.Binding, null);
3025
authorityBinding.Location = reader.GetAttribute(
SamlConstants
.AttributeNames.Location, null);
3063
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.AuthorityBinding,
SamlConstants
.Namespace);
3068
writer.WriteAttributeString(String.Empty,
SamlConstants
.AttributeNames.NamespaceAttributePrefix, null, authorityBinding.AuthorityKind.Namespace);
3072
writer.WriteStartAttribute(
SamlConstants
.AttributeNames.AuthorityKind, null);
3083
writer.WriteAttributeString(
SamlConstants
.AttributeNames.Location, null, authorityBinding.Location);
3085
writer.WriteAttributeString(
SamlConstants
.AttributeNames.Binding, null, authorityBinding.Binding);
3145
if (!reader.IsStartElement(
SamlConstants
.ElementNames.AuthorizationDecisionStatement,
SamlConstants
.Namespace))
3147
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4082,
SamlConstants
.ElementNames.AuthorizationDecisionStatement,
SamlConstants
.Namespace, reader.LocalName, reader.NamespaceURI)));
3151
authzStatement.Resource = reader.GetAttribute(
SamlConstants
.AttributeNames.Resource, null);
3157
string decisionString = reader.GetAttribute(
SamlConstants
.AttributeNames.Decision, null);
3179
if (reader.IsStartElement(
SamlConstants
.ElementNames.Subject,
SamlConstants
.Namespace))
3190
if (reader.IsStartElement(
SamlConstants
.ElementNames.Action,
SamlConstants
.Namespace))
3194
else if (reader.IsStartElement(
SamlConstants
.ElementNames.Evidence,
SamlConstants
.Namespace))
3238
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.AuthorizationDecisionStatement,
SamlConstants
.Namespace);
3240
writer.WriteAttributeString(
SamlConstants
.AttributeNames.Decision, null, statement.AccessDecision.ToString());
3242
writer.WriteAttributeString(
SamlConstants
.AttributeNames.Resource, null, statement.Resource);
3274
if (!reader.IsStartElement(
SamlConstants
.ElementNames.Evidence,
SamlConstants
.Namespace))
3276
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.ID4082,
SamlConstants
.ElementNames.Evidence,
SamlConstants
.Namespace, reader.LocalName, reader.NamespaceURI)));
3284
if (reader.IsStartElement(
SamlConstants
.ElementNames.AssertionIdReference,
SamlConstants
.Namespace))
3288
else if (reader.IsStartElement(
SamlConstants
.ElementNames.Assertion,
SamlConstants
.Namespace))
3327
writer.WriteStartElement(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.Evidence,
SamlConstants
.Namespace);
3331
writer.WriteElementString(
SamlConstants
.Prefix,
SamlConstants
.ElementNames.AssertionIdReference,
SamlConstants
.Namespace, evidence.AssertionIdReferences[i]);