ABP Framework version: v7.4.2
UI Type: Blazor WASM and Maui Blazor
Database System: SQL Server
Tiered (for MVC) or Auth Server Separated (for Angular): no
Exception message and full stack trace: blazor.webview.js:1 Uncaught (in promise) Error: Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase
1.<ThrowExceptionForResponseAsync>d__42[[Entrenou.Pharmacies.IPharmaciesAppService, Entrenou.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Http.Client\Volo\Abp\Http\Client\ClientProxying\ClientProxyBase.cs:line 258 at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase
1.<RequestAsync>d__36[[Entrenou.Pharmacies.IPharmaciesAppService, Entrenou.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Http.Client\Volo\Abp\Http\Client\ClientProxying\ClientProxyBase.cs:line 161 at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.<RequestAsync>d__35
1[[Entrenou.Pharmacies.IPharmaciesAppService, Entrenou.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Collections.Generic.List1[[Entrenou.Pharmacies.PharmacyInMapDto, Entrenou.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext() in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Http.Client\Volo\Abp\Http\Client\ClientProxying\ClientProxyBase.cs:line 86 at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptorClientProxy
1.<CallRequestAsync>d__01[[Entrenou.Pharmacies.IPharmaciesAppService, Entrenou.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Collections.Generic.List
1[[Entrenou.Pharmacies.PharmacyInMapDto, Entrenou.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext() in D:\ci\Jenkins\workspace\abp-volo-release\abp\framSteps to reproduce the issue:
- On a Maui Blazor project, have an expired access token
- Call the api with expired access token
- Api returns an exception with Unauthorized
We noticed a difference between our Blazor and Maui Blazor versions of the app. On Blazor, when the access token is expired, the application attempts to refresh the token before sending a request to the api. Therefore, the api doesn't return an exception and everything is fine.
On the other hand, in Maui Blazor, the app doesn't seem to refresh the expired token before sending a request. Thus, the api returns an unauthorized exception and our application shows us the reload button.
We also noticed that in our Blazor project, there isn't any refresh token and the login flow seems to be triggered instead (without asking the user to reenter credentials). In Maui Blazor, we do have a refresh token. Heres a screenshot of the http requests for the blazor project:
2 Answer(s)
-
0
The problem is easily reproduced with a newly scaffolded Maui Blazor project. It seems like the token refresh doesn't work at all, or doesn't even occur.
Heres a link to the zipped solution: https://filetransfer.io/data-package/3xvB5DqT#link
-
0
Hi,
ABP does not implement refresh token for MAUI Blazor, I will add it in next version