.NET 7 Custom AuthorizeAttribute never reaches OnAuthorization method and yet redirects to log in page

23 Views Asked by At

I have a custom AuthorizeAttribute which works great when a user is logged in (and interestingly enough on the production environment) but on my dev machine (using ngrok to handle external requests, a necessary complexity unfortunately) when a new user arrives at a controller method decorated with my CustomAuthorizeAttribute:

  1. The OnAuthorization() method of the attribute is never reached
  2. The user is immediately redirected to the wrong URL https://localhost/Account/Login (which is missing the required port)

Im trying to debug this but am a bit out of my depth. Any pointers would be most appreciated.

0

There are 0 best solutions below