コード例 #1
0
        /// <summary>
        /// Authenticates the request.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public bool AuthenticateRequest(ISnmpContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            return(context.Request.Version == Version && context.HandleMembership());
        }
コード例 #2
0
 /// <summary>
 /// Authenticates the request.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <returns></returns>
 public bool AuthenticateRequest(ISnmpContext context)
 {
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     
     return context.Request.Version == Version && context.HandleMembership();
 }
        /// <summary>
        /// <see cref="IMembershipProvider.AuthenticateRequest(ISnmpContext)"/>
        /// </summary>
        public bool AuthenticateRequest(ISnmpContext context, IList <IMembershipProvider> matchedMemberships)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (matchedMemberships == null)
            {
                matchedMemberships = new List <IMembershipProvider>();
            }

            var isAuthenticated = context.Request.Version == Version && context.HandleMembership();

            if (isAuthenticated)
            {
                matchedMemberships.Add(this);
            }

            return(isAuthenticated);
        }