Auth0 Home Blog Docs

LoginCallback.ashx throws error



I copied the code from the MVC sample and created the ashx inside my application (not MVC)

I got the valid token from authentication but the code throws an error at this line:

Error: ‘FederatedAuthentication.SessionAuthenticationModule’ threw an exception of type ‘System.InvalidOperationException’

StackTrace = " at System.IdentityModel.Services.FederatedAuthentication.GetCurrentContextItems()\r\n
at System.IdentityModel.Services.FederatedAuthentication.GetHttpContextModuleMap()\r\n
at System.IdentityModel.Services.FederatedAuthentication.GetHttpModuleT

Can someone help me with this?

Million thanks!