Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Refresh authentication cookie causing .NET Core Router Not Found

$
0
0

We're building an API which sends a GET request to our .NET Core app to retrieve the web page. To comply with authentication, we also supply it a .NET Application cookie (just copied from the browser after the user logs in). The problem comes when the cookie is changed (in this scenario, when another user would request the API and send their own cookie).

Authentication goes through normally (doesn't return the login page), but the Router component can't seem to find the endpoint (falls into the NotFound part of the router). What's interesting is, if I try with the same cookie 30-60 minutes later, it all of a sudden starts working. This makes me think it has something to do with invalidating cookies/validating new ones. Does anyone have any idea what the problem could be?

Code of the router:

<CascadingAuthenticationState><Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true"><Found Context="routeData"><AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /></Found><NotFound> //this is where it falls after the cookie changes<LayoutView Layout="@typeof(MainLayout)"><p>Sorry, there's nothing at this address.</p></LayoutView></NotFound></Router></CascadingAuthenticationState>

Inspecting the request, the user Claims are correct for the cookie, and the correct host and path are present in the request...


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>