コード例 #1
0
        protected override IEnumerable <XObject> GetXContent()
        {
            if (ForceAuthn.HasValue)
            {
                yield return(new XAttribute(Saml2Constants.Message.ForceAuthn, ForceAuthn));
            }

            if (IsPassive.HasValue)
            {
                yield return(new XAttribute(Saml2Constants.Message.IsPassive, IsPassive));
            }

            if (AssertionConsumerServiceUrl != null)
            {
                yield return(new XAttribute(Saml2Constants.Message.AssertionConsumerServiceURL, AssertionConsumerServiceUrl));
            }

            if (NameIdPolicy != null)
            {
                yield return(NameIdPolicy.ToXElement());
            }

            if (RequestedAuthnContext != null)
            {
                yield return(RequestedAuthnContext.ToXElement());
            }
        }
 public Saml2AuthenticationOptions()
     : base("Saml2Federation")
 {
     AuthenticationMode = AuthenticationMode.Passive;
     Caption            = "SAML";
     NameIdPolicy       = new NameIdPolicy {
         AllowCreate = true, Format = "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"
     };
     AuthnContextClassRef = new[] { AuthnContextClassTypes.PasswordProtectedTransport.OriginalString };
 }
 public Saml2AuthenticationOptions()
     : base("Saml2Federation")
 {
     AuthenticationMode = AuthenticationMode.Passive;
     Caption            = "SAML";
     NameIdPolicy       = new NameIdPolicy {
         AllowCreate = true, Format = "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"
     };
     //Comment out because AuthnContextClassRef not supported in ESAS/Shibboleth Identity Provider
     //AuthnContextClassRef = new[] { AuthnContextClassTypes.PasswordProtectedTransport.OriginalString };
 }