Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Core 2.0 Razor Pages Integrated with AAD

$
0
0

Our scenario involves using Razer Pages in a multi-tenant environment using AAD as the authentication provider.  I started following along with this project but found it to be a bit out of date with its implementation https://azure.microsoft.com/en-us/resources/samples/active-directory-dotnet-webapp-openidconnect-aspnetcore-v2/.  I was able to eventually get things to where AAD is sending the reply back to one of my pages after login, but now my application is throwing the following error:

Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ValidateAntiforgeryTokenAuthorizationFilter:Information: Antiforgery token validation failed. The required antiforgery cookie ".AspNetCore.Antiforgery.2WT_LURzPFU" is not present.
Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The required antiforgery cookie ".AspNetCore.Antiforgery.2WT_LURzPFU" is not present.
   at Microsoft.AspNetCore.Antiforgery.Internal.DefaultAntiforgery.<ValidateRequestAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ValidateAntiforgeryTokenAuthorizationFilter.<OnAuthorizationAsync>d__3.MoveNext()

I'm not able to hit any break points on my page, so this error is happening earlier in the page life cycle.  All Razor Pages documentation that mentions Antiforgery just talks about how the developer never has to worry about it.

Any support would be appreciated!


Viewing all articles
Browse latest Browse all 9386

Trending Articles



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