abp icon indicating copy to clipboard operation
abp copied to clipboard

Localhost authorize page not found

Open Nhannt2909 opened this issue 1 year ago • 8 comments

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.

Nhannt2909 avatar Sep 25 '24 07:09 Nhannt2909

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.

maliming avatar Sep 27 '24 00:09 maliming

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

Nhannt2909 avatar Sep 27 '24 01:09 Nhannt2909

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

gbrohammer avatar Sep 30 '24 15:09 gbrohammer

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

andrea-ble avatar Sep 30 '24 19:09 andrea-ble

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

gbrohammer avatar Oct 01 '24 07:10 gbrohammer

Just tried with a clean install, just windows 11 and visual studio. I confirm that 'abp new' is unable to create a working project

andrea-ble avatar Oct 03 '24 09:10 andrea-ble

I have The Same Problem And suddenly this issue appear, Is any one could solve it?

Hesham1Gomaa avatar Oct 05 '24 16:10 Hesham1Gomaa

Issue Fixed with me when I Run Project on IIS express Solve

Hesham1Gomaa avatar Oct 06 '24 16:10 Hesham1Gomaa

I got the same issue with new project created by the latest CLI version 8.3.3 image image

huytnd avatar Nov 14 '24 04:11 huytnd

hi all

Make sure the cshtml page first line is @page

https://github.com/abpframework/abp/blob/4564c1ec677cac60887a95378370ec8b32715bdf/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.cshtml#L1

maliming avatar Nov 14 '24 04:11 maliming

hi all

Make sure the cshtml page first line is @page

https://github.com/abpframework/abp/blob/4564c1ec677cac60887a95378370ec8b32715bdf/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.cshtml#L1

Edited, and it worked as expected.

huytnd avatar Nov 14 '24 04:11 huytnd