Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "Jorahealth"

HI @ismcagdas

We are in testing phase and dont have many tenant users. But it happens everytime to all tenant users.

We investigated this further....

We are only getting issue with Refresh token in TENANT. **It works in HOST. **

In Tenant here is the log again....

Refresh Token issue for Tenant ADMIN

Getting StatusCode: 500, ReasonPhrase: 'Internal Server Error' for 'https://10.0.2.2:44301/api/TokenAuth/RefreshToken'

AppData Log

INFO 2021-01-06 14:10:07,486 [109 ] Microsoft.AspNetCore.Hosting.Diagnostics - Request starting HTTP/1.1 POST https://10.0.2.2:44301/api/TokenAuth/RefreshToken application/x-www-form-urlencoded; charset=utf-8 884 INFO 2021-01-06 14:10:07,501 [109 ] ft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint 'Decisively.Web.Controllers.TokenAuthController.RefreshToken (Decisively.Web.Core)' INFO 2021-01-06 14:10:07,513 [109 ] c.Infrastructure.ControllerActionInvoker - Route matched with {action = "RefreshToken", controller = "TokenAuth", area = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Decisively.Authorization.Accounts.Dto.RefreshTokenResult] RefreshToken(System.String) on controller Decisively.Web.Controllers.TokenAuthController (Decisively.Web.Core). ERROR 2021-01-06 14:10:07,799 [101 ] Mvc.ExceptionHandling.AbpExceptionFilter - Refresh token is not valid!

We chaecked if the Refresh token stored and retried are the same and they are....

Received Refresh Token

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6IjEiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiYWRtaW4iLCJBc3BOZXQuSWRlbnRpdHkuU2VjdXJpdHlTdGFtcCI6IlJMNEJYN0ZYRURMSUJLM1NPRFlZTUtDSU5BUUxKRDNEI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I4Iiwic3ViIjoiMSIsImp0aSI6IjMxNWUxMzg4LTU1YTMtNDFhOS04MjM4LTczMDBlZTc4ZDQ1YiIsImlhdCI6MTYwOTk0NzUzMSwidG9rZW5fdmFsaWRpdHlfa2V5IjoiZGU2NjIwNmYtZTgwZi00ZjlkLWFlZWEtM2I1NGNhZGQ0NDY1IiwidXNlcl9pZGVudGlmaWVyIjoiMUA4IiwidG9rZW5fdHlwZSI6IjEiLCJuYmYiOjE2MDk5NDc1MzEsImV4cCI6MTY0MTQ4MzUzMSwiaXNzIjoiRGVjaXNpdmVseSIsImF1ZCI6IkRlY2lzaXZlbHkifQ._ThtS4KNnGdzXAydPmPbFcLMMH3DTXtacqJNdAGsKDw"

Thank you @alper

We are tried with commenting the the codes which use WebRequestExecuter directly in AppDelegate.cs class.** But it did not work. ** On Further investigation we understand that When we work with FCM, the code in AppDelegate.cs class "ApplicationBootstrapper.InitializeIfNeeds<DecisivelyXamarinIosModule>();" calling the method "userConfigurationService.GetAsync(AccessTokenManager.IsUserLoggedIn)". And retuns null as result in Decisively.ViewModels.Base.UserConfigurationManager.cs class. And it throwing null object reference exception and calling App.ExitApplication(); method.

Without FCM integration code it works perfectly and got result.

Any response? I would reaaly appreciate it if you could come back to me on this one quickly....

This is still not working for us and the app crashes after expriry of the token.

I had not replied earlier as I felt this issue would be addressed, Could you please suggest a solution or work around?

Many Thanks

Hi ismcagdas

I am adding screen shots of the application log ...where it says the refresh token is not valid! I have sent the token to the email as requested but have had no response?? Could you please provide a response for this?

Hi, Any updates on this, I had sent the token via email. Your support is greatly appreciated.

Hi ismcagdas I have sent this to the email....

The Access token validity is for a day, the refresh token 1 year, looks like the access token is not being renewed and the issue is with the refresh token. We reduced the refresh token expiry to 10 mins and then it automatically redirects to the login page on the mobile app.

I am pasting the full log....

Exception Log from Mobile

{Flurl.Http.FlurlHttpException: Call failed with status code 500 (Internal Server Error): POST http://10.0.2.2:22742/api/TokenAuth/RefreshToken at Flurl.Http.FlurlRequest.HandleExceptionAsync (Flurl.Http.HttpCall call, System.Exception ex, System.Threading.CancellationToken token) [0x00105] in <7be22aadf26d4808b35d54cc18db202b>:0 at Flurl.Http.FlurlRequest.SendAsync (System.Net.Http.HttpMethod verb, System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken, System.Net.Http.HttpCompletionOption completionOption) [0x003a1] in <7be22aadf26d4808b35d54cc18db202b>:0 at Flurl.Http.FlurlRequest.SendAsync (System.Net.Http.HttpMethod verb, System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken, System.Net.Http.HttpCompletionOption completionOption) [0x004bb] in <7be22aadf26d4808b35d54cc18db202b>:0 at Flurl.Http.HttpResponseMessageExtensions.ReceiveJson[T] (System.Threading.Tasks.Task1[TResult] response) [0x0006e] in <7be22aadf26d4808b35d54cc18db202b>:0 at Decisively.ApiClient.AccessTokenManager.RefreshTokenAsync () [0x000a1] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Application.Client\ApiClient\AccessTokenManager.cs:93 at Decisively.Configuration.UserConfigurationService.RefreshAccessTokenAndSendRequestAgain () [0x0003e] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Application.Client\Configuration\UserConfigurationService.cs:63 at Decisively.Configuration.UserConfigurationService.GetAuthenticatedUserConfig () [0x00178] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Application.Client\Configuration\UserConfigurationService.cs:46 at Decisively.Configuration.UserConfigurationService.GetAsync (System.Boolean isUserLoggedIn) [0x00036] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Application.Client\Configuration\UserConfigurationService.cs:27 at Decisively.ViewModels.Base.UserConfigurationManager+<>c__DisplayClass4_0.<GetAsync>b__0 () [0x0002e] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Mobile.Shared\ViewModels\Base\UserConfigurationManager.cs:41 at Decisively.Core.Threading.WebRequestExecuter.Execute[TResult] (System.Func1[TResult] func, System.Func2[T,TResult] successCallback, System.Func2[T,TResult] failCallback, System.Action finallyCallback) [0x002a1] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Mobile.Shared\Core\Threading\WebRequestExecuter.cs:53 }


API Error Log

INFO 2020-09-25 14:59:19,169 [94 ] Microsoft.AspNetCore.Hosting.Diagnostics - Request starting HTTP/1.1 POST http://localhost:22742/api/TokenAuth/RefreshToken?refreshToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6IjEiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiYWRtaW4iLCJBc3BOZXQuSWRlbnRpdHkuU2VjdXJpdHlTdGFtcCI6IktHU0pNNFMyNkc1QzVaU05FRUZKWU5KV1Q1M0JRU1JWIiwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9yb2xlIjoiQWRtaW4iLCJodHRwOi8vd3d3LmFzcG5ldGJvaWxlcnBsYXRlLmNvbS9pZGVudGl0eS9jbGFpbXMvdGVuYW50SWQiOiIxNSIsInN1YiI6IjEiLCJqdGkiOiI3Mjg0NDZlNS00NWMwLTQxMzItOGY3My02OTY5ZWQzYWJjZGEiLCJpYXQiOjE2MDA5NTMwMDMsInRva2VuX3ZhbGlkaXR5X2tleSI6Ijk2ZTNhM2NjLTZmZGItNGU0MS04MzVmLTc3ZmZjNDRhZGUyZSIsInVzZXJfaWRlbnRpZmllciI6IjFAMTUiLCJ0b2tlbl90eXBlIjoiMSIsIm5iZiI6MTYwMDk1MzAwMywiZXhwIjoxNjMyNDg5MDAzLCJpc3MiOiJEZWNpc2l2ZWx5IiwiYXVkIjoiRGVjaXNpdmVseSJ9.IVAwaBWY5IGKkSxHo_pnl4LHlcMFbAvgTW0RkfkIciE application/json 247 INFO 2020-09-25 14:59:19,170 [94 ] uthentication.JwtBearer.JwtBearerHandler - Bearer was not authenticated. Failure message: No SecurityTokenValidator available for token: AIzaSyBd_YpujEtRhFD1cTA9zL9FcWyEV0qACJo INFO 2020-09-25 14:59:19,170 [94 ] ft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint 'Decisively.Web.Controllers.TokenAuthController.RefreshToken (Decisively.Web.Core)' INFO 2020-09-25 14:59:19,191 [94 ] c.Infrastructure.ControllerActionInvoker - Route matched with {action = "RefreshToken", controller = "TokenAuth", area = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Decisively.Authorization.Accounts.Dto.RefreshTokenResult] RefreshToken(System.String) on controller Decisively.Web.Controllers.TokenAuthController (Decisively.Web.Core). ERROR 2020-09-25 14:59:19,271 [9 ] Mvc.ExceptionHandling.AbpExceptionFilter - Refresh token is not valid! System.ComponentModel.DataAnnotations.ValidationException: Refresh token is not valid! ---> System.InvalidOperationException: Navigation property 'Claims' on entity of type 'User' cannot be loaded because the entity is not being tracked. Navigation properties can only be loaded for tracked entities. at Microsoft.EntityFrameworkCore.Internal.EntityFinder1.LoadAsync(INavigation navigation, InternalEntityEntry entry, CancellationToken cancellationToken) at Abp.Domain.Repositories.RepositoryExtensions.EnsureCollectionLoadedAsync[TEntity,TPrimaryKey,TProperty](IRepository2 repository, TEntity entity, Expression1 collectionExpression, CancellationToken cancellationToken) at Abp.Authorization.Users.AbpUserStore2.GetClaimsAsync(TUser user, CancellationToken cancellationToken) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Microsoft.AspNetCore.Identity.UserManager1.GetClaimsAsync(TUser user) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Microsoft.AspNetCore.Identity.UserClaimsPrincipalFactory1.GenerateClaimsAsync(TUser user) at Microsoft.AspNetCore.Identity.UserClaimsPrincipalFactory2.GenerateClaimsAsync(TUser user) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Microsoft.AspNetCore.Identity.UserClaimsPrincipalFactory1.CreateAsync(TUser user) at Abp.Authorization.AbpUserClaimsPrincipalFactory2.CreateAsync(TUser user) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Decisively.Web.Controllers.TokenAuthController.RefreshToken(String refreshToken) in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Web.Core\Controllers\TokenAuthController.cs:line 238 --- End of inner exception stack trace --- at Decisively.Web.Controllers.TokenAuthController.RefreshToken(String refreshToken) in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Web.Core\Controllers\TokenAuthController.cs:line 250 at lambda_method(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.

The token is truncated

Showing 11 to 20 of 37 entries