Base solution for your next web application
Open Closed

Handling refreshing token in client #12240


User avatar
0
hongbing.wang created

Hi,

ASP.NET Zero API: v13.3.0 | Angular client: v13.3.0

We want to shorten AccessTokenExipration to 15 minutes and RefreshTokenExpiration to 7 days.

The API Task<RefreshTokenResult> RefreshToken(string refreshToken) works fine in Swagger UI. However, there are following issues with the Angular client.

When the access token expires, if customer tries to open any page that is not on the main tree, it gives an internal error, instead of re-routing to the login page.

For example:

Go to Departments page and wait 15 minutes

Go to Custom fields page and get Internal error

Go to Controllers page and get Internal error

Go to Alarms page and now it redirects you to the login page

More importantly, RefreshToken is not called or not working in the client.

Has the RefreshToken() been fully implemented in the client? If not, please advise the method for the implementation.

We are aware that there is "this._tokenAuthService.refreshToken(token)" in tryAuthWithRefreshToken() in "src\account\auth\zero-refresh-token.service.ts". this._refreshTokenService.tryAuthWithRefreshToken() is called by canActivateInternal in "src\app\shared\common\auth\auth-route-guard.ts". But we need further assistance.


No answer yet!