getValidAccessToken

suspend fun getValidAccessToken(): String?

Returns a valid access token if one is present. If the access token is invalid, and there is a refresh token, a Token refresh is attempted via Credential.refreshToken. If the refresh results in a valid access token, it is returned.

See Credential.getAccessTokenIfValid for what makes an access token valid.