Raise exception if authentication failed