public User GetUserByCredentials(string email, string password)
        {
            var oneTimeClient = new PortalApiClient(_baseUrl, email.EncodeToBase64(), password.EncodeToBase64());

            PortalUserInfo user;

            try
            {
                user = oneTimeClient.GetCurrentUserInfo();
            }
            catch (AuthenticationException)
            {
                return(null);
            }

            if (user == null)
            {
                return(null);
            }

            PortalProfile userProfile = _portalApiClient.GetUserInfoById(user.UserId);

            if (userProfile == null)
            {
                return(null);
            }

            User addUser = GetUserInfo(userProfile);

            return(addUser);
        }
 public PortalUsersProvider(string baseUrl, string encryptedLogin, string encryptedPassword)
 {
     _baseUrl         = baseUrl;
     _portalApiClient = new PortalApiClient(baseUrl, encryptedLogin, encryptedPassword);
 }