C
C#3w ago
Juststs

✅ WSFED authentication and '.AspNetCore.Correlation.A...' cookie not found.

Im trying to setup wsfed for my companies app. We have a VB app that has a login page, where we want to add a new button that would lead to a asp net core 9.0 C# app, where the user would authenticate. The workflow would be that the user presses the button in the VB web app, that would make a post request to the C# apps SignIn method, that would then execute a Challenge on a scheme. This would return a 302, from which i try to extract the location. Then i just redirect the user to that location. Problem is im consistently encountering a:
c#
[2025-02-17 12:34:51.225 +02:00 WRN] '.AspNetCore.Correlation.A...' cookie not found.
[2025-02-17 12:34:51.226 +02:00 INF] Error from RemoteAuthentication: Correlation failed..
[2025-02-17 12:34:51.229 +02:00 ERR] Connection ID "1...", Request ID "4...": An unhandled exception was thrown by the application.
Microsoft.AspNetCore.Authentication.AuthenticationFailureException: An error was encountered while handling the remote login.
---> Microsoft.AspNetCore.Authentication.AuthenticationFailureException: Correlation failed.
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler`1.HandleRequestAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync()
c#
[2025-02-17 12:34:51.225 +02:00 WRN] '.AspNetCore.Correlation.A...' cookie not found.
[2025-02-17 12:34:51.226 +02:00 INF] Error from RemoteAuthentication: Correlation failed..
[2025-02-17 12:34:51.229 +02:00 ERR] Connection ID "1...", Request ID "4...": An unhandled exception was thrown by the application.
Microsoft.AspNetCore.Authentication.AuthenticationFailureException: An error was encountered while handling the remote login.
---> Microsoft.AspNetCore.Authentication.AuthenticationFailureException: Correlation failed.
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler`1.HandleRequestAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync()
Can anybody help? The VB web app is running locally via https, and the C# is hosted on IIS. Idk if thats relavent. Both should be using https. Running the exact same method via the C# app gives me a good result, and no exception. We tried samesite=none and other cookie setttings for the C# app, and it doesnt seem to work. Tho i did try this when i used http for the VB app, but https and the original C# code lead to the same exception.
2 Replies
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX3w ago
If you have no further questions, please use /close to mark the forum thread as answered

Did you find this page helpful?