Fix getAccessToken to throw exception after attempting maxGetTokenRetires times.