Authentication retrying loop