2024-08-30 17:28:50.312 +03:00 [INF] Request starting HTTP/2 GET https://mykgsapi.erciyes.edu.tr/hangfire - - 2024-08-30 17:28:50.335 +03:00 [ERR] An exception was thrown while deserializing the token. Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The antiforgery token could not be decrypted. ---> System.Security.Cryptography.CryptographicException: The key {***} was not found in the key ring. For more information go to http://aka.ms/dataprotectionwarning at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(Byte[] protectedData, Boolean allowOperationsOnRevokedKeys, UnprotectStatus& status) at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Unprotect(Byte[] protectedData) at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken) --- End of inner exception stack trace --- at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken) at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.GetCookieTokenDoesNotThrow(HttpContext httpContext) 2024-08-30 17:28:50.347 +03:00 [INF] Request finished HTTP/2 GET https://mykgsapi.erciyes.edu.tr/hangfire - - - 401 - - 35.4183ms 2024-08-30 17:28:50.943 +03:00 [INF] Executing ObjectResult, writing value of type 'System.String'. 2024-08-30 17:28:50.949 +03:00 [INF] Executed action MYKGS.Controllers.Terminals.TerminalController.GetStatus (MYKGS.HttpApi) in 901.7395ms 2024-08-30 17:28:50.949 +03:00 [INF] Executed endpoint 'MYKGS.Controllers.Terminals.TerminalController.GetStatus (MYKGS.HttpApi)' 2024-08-30 17:28:50.950 +03:00 [INF] Request finished HTTP/1.1 GET http://mykgsapi.erciyes.edu.tr/api/app/terminals/get-status?DATAS=RO9+kO+aSF5cpHUCFoH12UfChW8cHedRkFYPm7/VkcNn00z6kt22gMIrwobM1de8e4unSckmpswBQQVdCWEKPrQg3lSqdvTX7bmn3PUwin70nWp5sU/rw5cvtIxpDYaQ14Y2qResiujfFfVZhyxaPsJwkV7A+KiMlZ3Ysbx6JgUK6u6pH9jWGOcpKAT1tuT8 application/json - - 200 - text/plain;+charset=utf-8 1650.9087ms 2024-08-30 17:28:51.422 +03:00 [INF] Executed endpoint 'Health checks' 2024-08-30 17:28:51.426 +03:00 [INF] Request finished HTTP/1.1 GET https://mykgsapi.erciyes.edu.tr/health-status - - - 200 - application/json 2046.5687ms 2024-08-30 17:28:51.429 +03:00 [INF] Received HTTP response headers after 2114.8712ms - 200 2024-08-30 17:28:51.430 +03:00 [INF] End processing HTTP request after 2125.8605ms - 200
401 error code
It worked locally, but I'm still getting a 401 error on the server.
I couldn't resolve it. I'm still getting a 401 error. Is it possible to redirect to the login screen immediately after accessing Hangfire if a 401 error occurs, and then return to Hangfire afterwards?
app.UseConfiguredEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapHub<TerminalHub>("/terminal-hub", options =>
{
options.LongPolling.PollTimeout = TimeSpan.FromSeconds(30);
});
});
This code is also in my code, I added it as you mentioned, but it's still the same.
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
app.UseResponseCompression();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseAbpRequestLocalization();
app.UseStaticFiles();
app.UseAbpSecurityHeaders();
app.UseRouting();
app.UseCors();
app.UseAuthentication();
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}
app.UseAuthorization();
app.UseSwagger();
app.UseAbpSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "MYKGS API");
var configuration = context.GetConfiguration();
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
});
app.UseAuditing();
app.UseAbpSerilogEnrichers();
app.UseUnitOfWork();
app.UseConfiguredEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapHub<TerminalHub>("/terminal-hub", options =>
{
options.LongPolling.PollTimeout = TimeSpan.FromSeconds(30);
});
});
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
AsyncAuthorization = new[] { new AbpHangfireAuthorizationFilter(false) }
});
//app.UseHangfireDashboard("/hangfire");
RecurringJobs.ManageResignedAndExpiredJobs();
}
The messages you sent seem to be inside the thread. I'm getting a 401 error when trying to open the UI because the user information is empty
2024-05-18 12:25:13.785 +03:00 [ERR] Request Entity Too Large
Volo.Abp.Http.Client.AbpRemoteCallException: Request Entity Too Large
at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase
1.RequestAsync(ClientProxyRequestContext requestContext)
at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptorClientProxy
1.CallRequestAsync[T](ClientProxyRequestContext requestContext)
at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.CallRequestAsync[T](ClientProxyRequestContext context) at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor
1.GetResultAsync(Task task, Type resultType)
at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter
1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue
1.ProceedAsync()
at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func
3 proceed)
at Pbys.Blazor.Pages.EmployeeManagement.Employee.Card.Tabs.Personality.DutyItems.EmployeeDuties.UpdateDecree(CreateDecreeParameterDto createDecreeParameterDto) in C:\Pbys\aspnet-core\src\Pbys.Blazor\Pages\EmployeeManagement\Employee\Card\Tabs\Personality\DutyItems\EmployeeDuties.razor.cs:line 309
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Pbys.Blazor.Pages.EmployeeManagement.DecreeOperation.Decree.List.Components.CreateDecreeModal.<>c__DisplayClass124_0.<<CreateOrUpdateDecreeAsync>b__3>d.MoveNext() in C:\Pbys\aspnet-core\src\Pbys.Blazor\Pages\EmployeeManagement\DecreeOperation\Decree\List\Components\CreateDecreeModal.razor:line 334
--- End of stack trace from previous location ---
at Pbys.Blazor.Pages.EmployeeManagement.DecreeOperation.Decree.List.Components.CreateDecreeModal.CreateOrUpdateDecreeAsync() in C:\Pbys\aspnet-core\src\Pbys.Blazor\Pages\EmployeeManagement\DecreeOperation\Decree\List\Components\CreateDecreeModal.razor:line 332
Hello, We save the following link to the web browser bookmarks as an example: [https://pbysidentity.erciyes.edu.tr/Account/Login?ReturnUrl=%2Fconnect%2Fauthorize%3Fclient_id%3DPbys_BlazorServerTiered%26redirect_uri%3Dhttps%253A%252F%252Fpbys.erciyes.edu.tr%252Fsignin-oidc%26response_type%3Dcode%2520id_token%26scope%3Dopenid%2520profile%2520roles%2520email%2520phone%2520Pbys%26response_mode%3Dform_post%26nonce%3D638457378682159723.ZDc5ZTgzYzEtOGMzMC00N2MwLWEyZWQtOTA5MmM0YWMwM2Y3ZGQ0YWViMDMtZWExMy00OTBmLWJhMGEtYmIyMzZkYjk1OTYz%26state%3DCfDJ8M2WpbVwVzdBgEW9NajIHVUT12lr6ZpIwCvlW1Owv2fi7EqxGETRXHlqprPMvVI9SU0Nk3f14VG005zQmioP01AhtSG2KtdwYmaRy6Pn9t5jvfXiyu70oIGwbfouwxTtqhE-UuL02Q3NYMWRDMomQP7uC_uH6e3yh2xK4c3OKFcKaU0Bppso2tUDPgHMKcYt05jWqV_Vqu8ow4QUMi4-HtymTmNMqUb6nKVtYAnHzM9KS50EkpQOfH9ma-fzFdrvG3x2iBPM-zmKgQJx2mVcvEafW-7axOKUW-oO9LXpigET%26x-client-SKU%3DID_NET6_0%26x-client-ver%3D6.15.1.0]. After some time, when we try to log in using this bookmark, it gives a 400 error. Clicking the 'Go to Homepage' button under the 400 error redirects to the dashboard, and the system continues to work. How can we directly redirect to the dashboard without encountering the 400 error?