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?
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?
2024-03-11 13:06:50.811 +03:00 [WRN] '.AspNetCore.Correlation.lzvYwlVkn0QoYXwJXXcoVGrqBXn2o-9cDRq0wlHK9dU' cookie not found.
2024-03-11 13:06:50.811 +03:00 [INF] Error from RemoteAuthentication: Correlation failed..
2024-03-11 13:06:50.811 +03:00 [ERR] An unhandled exception has occurred while executing the request.
System.Exception: An error was encountered while handling the remote login.
---> System.Exception: Correlation failed.
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler1.HandleRequestAsync() at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|8_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task) 2024-03-11 13:06:50.812 +03:00 [INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController.Index (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared)' 2024-03-11 13:06:50.812 +03:00 [INF] Route matched with {action = "Index", controller = "Error", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task
1[Microsoft.AspNetCore.Mvc.IActionResult] Index(Int32) on controller Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared).
2024-03-11 13:06:50.812 +03:00 [WRN] The required antiforgery cookie ".AspNetCore.Antiforgery.xVgQ5_tGIfw" is not present.
2024-03-11 13:06:50.812 +03:00 [INF] Authorization failed for the request at filter 'Volo.Abp.AspNetCore.Mvc.AntiForgery.AbpAutoValidateAntiforgeryTokenAuthorizationFilter'.
2024-03-11 13:06:50.812 +03:00 [INF] Executing StatusCodeResult, setting HTTP status code 400
2024-03-11 13:06:50.812 +03:00 [INF] Executed action Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController.Index (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared) in 0.3493ms
2024-03-11 13:06:50.812 +03:00 [INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController.Index (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared)'
2024-03-11 13:06:50.812 +03:00 [INF] Request finished HTTP/2 POST https://pbys.erciyes.edu.tr/signin-oidc application/x-www-form-urlencoded 1711 - 302 - - 2.6636ms
2024-03-11 13:06:50.821 +03:00 [INF] Request starting HTTP/2 GET https://pbys.erciyes.edu.tr/Error?httpStatusCode=400 - -
2024-03-11 13:06:50.822 +03:00 [INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController.Index (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared)'
2024-03-11 13:06:50.822 +03:00 [INF] Route matched with {action = "Index", controller = "Error", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.IActionResult] Index(Int32) on controller Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared).
2024-03-11 13:06:50.825 +03:00 [INF] Executing ViewResult, running view ~/Views/Error/Default.cshtml.
It gave the same error on Edge as well. What can we do?