Hi,
I'm new to ionic & angular, currently trying to build an android app. Using OAUTH 2(also new at here) for resource authorization. Now, stuck at one point & want to know how you peoples handle such issues.
Basically, in my app there 3 different blocks communicate with each other to do the job. These are -
1 - Client-side app(ionic app)
2 - Resource Server
3 - OAuth Server
After successfully, getting the Access_Token & Refresh_Token from OAuth Server, whenever the Client-side app needs any resource it makes an HTTP request to Resource Server by attaching the Access_Token with the request. Then Resource Server verify that Access_Token with OAuth server. If Access_Token found as valid Resource Server return the desire resource else return error.
So, here my problem is - if Access_Token has expired & in Client-side I got the error also from Resource Server, then how I'll get the new Access_Token & resend that with a new HTTP request. Because, the moment I'll make an HTTP request for a new Access_Token, I'll lose the previous User's Request. Then, after getting the new Access_Token, how I'll trigger old HTTP request of the user's to get his/her required resources.