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
Hello, I've implemented Hangfire authorization, but even though I'm logged in, currentUser is coming back as null. What could be the reason for this?
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, When I try to upload a 23 MB file, I receive a Request Entity Too Large error. I've tried to increase the file size in the config settings, but it didn't work, and I'm still getting the same error. Can you help?