예제 #1
0
 /// <summary>
 /// Initializes a new instance of <see cref="SamlAuthorizationDecisionStatement"/> class from
 /// a resource and decision.
 /// </summary>
 /// <param name="subject">The <see cref="SamlSubject"/> of the statement.</param>
 /// <param name="resource">The resource to be authorized.</param>
 /// <param name="decision">The AccessDecision in use.</param>
 /// <param name="actions"><see cref="IEnumerable{SamlAction}"/>.</param>
 public SamlAuthorizationDecisionStatement(
     SamlSubject subject,
     string resource,
     string decision,
     IEnumerable <SamlAction> actions)
     : this(subject, resource, decision, actions, null)
 {
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of <see cref="SamlAuthorizationDecisionStatement"/> class from
 /// a resource and decision.
 /// </summary>
 /// <param name="subject">The <see cref="SamlSubject"/> of the statement.</param>
 /// <param name="resource">The resource to be authorized.</param>
 /// <param name="decision">The AccessDecision in use.</param>
 /// <param name="actions"><see cref="IEnumerable{SamlAction}"/>.</param>
 /// <param name="evidence">Collection of <see cref="SamlEvidence"/> specifications.</param>
 public SamlAuthorizationDecisionStatement(
     SamlSubject subject,
     string resource,
     string decision,
     IEnumerable <SamlAction> actions,
     SamlEvidence evidence)
 {
     Actions  = (actions == null) ? throw LogArgumentNullException(nameof(actions)) : new List <SamlAction>(actions);
     Evidence = evidence;
     Decision = decision;
     Resource = resource;
     Subject  = subject;
     CheckObjectValidity();
 }
예제 #3
0
        /// <summary>
        /// Creates an instance of <see cref="SamlAuthenticationStatement"/>.
        /// </summary>
        /// <param name="samlSubject">The Subject of the Statement.</param>
        /// <param name="authenticationMethod">The URI reference that specifies the type of authentication that took place.</param>
        /// <param name="authenticationInstant">The time at which the authentication took place.</param>
        /// <param name="dnsAddress">The DNS domain name for the system entity from which the subject was apparently authenticated.</param>
        /// <param name="ipAddress">The IP address for the system entity from which the subject was apparently authenticated.</param>
        /// <param name="authorityBindings"><see cref="IEnumerable{SamlAuthorityBinding}"/>.</param>
        public SamlAuthenticationStatement(
            SamlSubject samlSubject,
            string authenticationMethod,
            DateTime authenticationInstant,
            string dnsAddress,
            string ipAddress,
            IEnumerable <SamlAuthorityBinding> authorityBindings)
        {
            if (string.IsNullOrEmpty(authenticationMethod))
            {
                throw LogArgumentNullException(nameof(authenticationMethod));
            }

            AuthenticationMethod  = authenticationMethod;
            AuthenticationInstant = authenticationInstant.ToUniversalTime();
            DnsAddress            = dnsAddress;
            IPAddress             = ipAddress;
            Subject = samlSubject;

            AuthorityBindings = (authorityBindings == null) ? new List <SamlAuthorityBinding>() : new List <SamlAuthorityBinding>(authorityBindings);
        }
예제 #4
0
 /// <summary>
 /// Creates an instance of <see cref="SamlAttributeStatement"/>.
 /// </summary>
 /// <param name="samlSubject">The subject of the attribute statement.</param>
 /// <param name="attributes"><see cref="IEnumerable{SamlAttribute}"/>.</param>
 public SamlAttributeStatement(SamlSubject samlSubject, IEnumerable <SamlAttribute> attributes)
 {
     Subject    = samlSubject;
     Attributes = (attributes == null) ? throw LogArgumentNullException(nameof(attributes)) : new List <SamlAttribute>(attributes);
 }
예제 #5
0
 /// <summary>
 /// Creates an instance of <see cref="SamlAttributeStatement"/>.
 /// </summary>
 /// <param name="samlSubject">The subject of the attribute statement.</param>
 /// <param name="attribute">The <see cref="SamlAttribute"/> contained in this statement.</param>
 public SamlAttributeStatement(SamlSubject samlSubject, SamlAttribute attribute)
     : this(samlSubject, new SamlAttribute[] { attribute })
 {
 }