automatic token refresh, use password grant auth

before sending a request, check if the token is about to expire and
refresh it beforehand

[#43577727]