My OAuth service is never refreshing (even manually), and the service is never recognizing my token as 'expired' also.
I noticed that the service was trying to access the 'refreshUrl_' when that variable was never setted up (=null).
So, I solved setting the refreshUrl_ to same as tokenUrl (.setRefreshUrl()) and manually refreshing (service.refresh()) when my API returned unauthorized.
My OAuth service is never refreshing (even manually), and the service is never recognizing my token as 'expired' also.
I noticed that the service was trying to access the 'refreshUrl_' when that variable was never setted up (=null).
So, I solved setting the refreshUrl_ to same as tokenUrl (.setRefreshUrl()) and manually refreshing (service.refresh()) when my API returned unauthorized.
I hope it may helps someone.