abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.81k stars 3.41k forks source link

Localhost authorize page not found #20883

Open Nhannt2909 opened 1 week ago

Nhannt2909 commented 1 week ago

I have a Multi layer Blazor application running on ASP.NET Core using ABP.IO framework. Currently having a problem with authorization with swagger UI. It was working fine but suddenly not.

When i click on Authorize btn on swagger ui it should open up a second tab with UI for username password entering. But it does not & displays ERROR 404 page. image All migrations are applied & database is up to date. Database also has the required seed data inserted by DBMigrator. I have tried a different browser too.

Here's my appsettings.json { "App": { "SelfUrl": "https://localhost:44311", "CorsOrigins": "https://*.BlazorBase.com,https://localhost:44351", "RedirectAllowedUrls": "https://localhost:44351" }, "ConnectionStrings": { }, "AuthServer": { "Authority": "https://localhost:44311", "RequireHttpsMetadata": false, "SwaggerClientId": "BlazorBase_Swagger" }, "StringEncryption": { "DefaultPassPhrase": "vo4t1mKuJyXDm5It" } } I have tried going through logs in visual studio's output tab: 2024-09-25 14:23:40.302 +07:00 [DBG] The event OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext was marked as rejected by OpenIddict.Validation.OpenIddictValidationHandlers+ValidateRequiredTokens. 2024-09-25 14:23:40.302 +07:00 [DBG] AuthenticationScheme: OpenIddict.Validation.AspNetCore was not authenticated. 2024-09-25 14:23:40.304 +07:00 [INF] Request finished HTTP/2 GET https://localhost:44311/connect/authorize?response_type=code&client_id=BlazorBase_Swagger&redirect_uri=https%3A%2F%2Flocalhost%3A44311%2Fswagger%2Foauth2-redirect.html&scope=BlazorBase&state=V2VkIFNlcCAyNSAyMDI0IDE0OjIzOjQwIEdNVCswNzAwIChJbmRvY2hpbmEgVGltZSk%3D - 404 null null 46.5492ms 2024-09-25 14:23:40.304 +07:00 [INF] Request reached the end of the middleware pipeline without being handled by application code. Request path: GET https://localhost:44311/connect/authorize, Response status code: 404 I try delete postgresql many time but this wont work again.

maliming commented 5 days ago

hi

Please share the authserver module code as well.

Thanks.

Nhannt2909 commented 5 days ago

hi

  • Your ABP Framework version.
  • Exception message and stack trace if available (check the logs).
  • Please share the steps and code to reproduce the problem.

Please share the authserver module code as well.

Thanks.

I am using the latest version that I created on the https://abp.io/get-started page 3 day ago. I don't think I have adjusted anything in the authserver module. The log is here: 2024-09-25 14:23:40.302 +07:00 [DBG] The event OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext was marked as rejected by OpenIddict.Validation.OpenIddictValidationHandlers+ValidateRequiredTokens. 2024-09-25 14:23:40.302 +07:00 [DBG] AuthenticationScheme: OpenIddict.Validation.AspNetCore was not authenticated. 2024-09-25 14:23:40.304 +07:00 [INF] Request finished HTTP/2 GET https://localhost:44311/connect/authorize?response_type=code&client_id=BlazorBase_Swagger&redirect_uri=https%3A%2F%2Flocalhost%3A44311%2Fswagger%2Foauth2-redirect.html&scope=BlazorBase&state=V2VkIFNlcCAyNSAyMDI0IDE0OjIzOjQwIEdNVCswNzAwIChJbmRvY2hpbmEgVGltZSk%3D - 404 null null 46.5492ms 2024-09-25 14:23:40.304 +07:00 [INF] Request reached the end of the middleware pipeline without being handled by application code. Request path: GET https://localhost:44311/connect/authorize, Response status code: 404

gbrohammer commented 2 days ago

I seem to be having the same issue all of the sudden.

The event OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext was marked as rejected by OpenIddict.Validation.OpenIddictValidationHandlers+ValidateRequiredTokens. [17:56:04 DBG] AuthenticationScheme: OpenIddict.Validation.AspNetCore was not authenticated. [17:56:04 INF] Request finished HTTP/2 GET https://localhost:44328/connect/authorize?response_type=code&client_id=DRG_App&state=...... - 404 0 null 688.4919ms [17:56:04 INF] Request reached the end of the middleware pipeline without being handled by application code. Request path: GET https://localhost:44328/connect/authorize, Response status code: 404

andrea-ble commented 2 days ago

Same here. Not only with the latest abp framework 8.3.1 but also with previous versions. I think the problem might be related to some Windows/Visual Studio updates. No project created with 'abp new' command works for me, it stops with the same Iog:

2024-09-30 15:38:18.300 +02:00 [DBG] AuthenticationScheme: OpenIddict.Validation.AspNetCore was not authenticated. 2024-09-30 15:38:18.474 +02:00 [INF] Request finished HTTP/2 GET https://localhost:44312/ - 404 null null 1308.8828ms 2024-09-30 15:38:18.477 +02:00 [INF] Request reached the end of the middleware pipeline without being handled by application code. Request path: GET https://localhost:44312/, Response status code: 404

gbrohammer commented 1 day ago

By switching to WSL Linux I can confirm the problem went away. It's related to Windows somehow.