Authentication with Bearer access_token and refresh_token

Thanks again, so I setup my backend authentication service as if it was a Social Network. While If I want to handle each part automatically I would need to do so for each call I do (so for example catch errors at every call ) which would be crazy.
Cause otherwise I was looking at this post : [Showcase] Manual OAuth2 Token Integration that uses Custom Token , would it work the same for my occasion ?