c# - Async request to OAuth API -
situation: have web application showning different types of information (mostly charts) on page (mvc). further reference lets call them widgets. data collected oauth2 protected web api. accestoken stored in users session (don't know if right place yet, that's not question here).
wanted solution: each widget on page, data collected using ajax calls webserver. webserver in turn calls odata api. data manipulation , returns result client. should work asynchronous.
the problem: can happen (at least in theory) first x ajax calls succeed. access-token api expires , new access-token has requested. of course should happen once , not each remaining ajax call prevent them invalidate each others access-tokens. how handle situation? ajax-calls executed synchronous (because of writeable session in .net) , each widget updated after other.
we make 1 request widgets (client server, not server api), doesn't feel right. besides, not move problem client server witch has call api each widget (asynchronous)
Comments
Post a Comment