Esempio n. 1
0
        private static bool _isValidClient(WebServiceSoapHeader mailSoapHeader)
        {
            foreach (AuthCredentialElement authCred in AuthCredentialsSection.AuthCredentialSettings.AuthCredentials)
            {
                if (authCred.ClientId.Equals(mailSoapHeader.ClientId) && authCred.AuthKey.Equals(mailSoapHeader.AuthKey))
                    return true;
            }

            return false;
        }
Esempio n. 2
0
        public static Result CheckSoapHeader(WebServiceSoapHeader MailSoapHeader)
        {
            Result result = new Result();

            if (MailSoapHeader == null)
            {
                result.Status = 3;
                result.Message = "Authentication failed";
                return result;
            }

            if(!_isValidClient(MailSoapHeader))
            {
                result.Status = 4;
                result.Message = "Authentication failed";
                return result;
            }

            return result;
        }