.net Core Google Authentication Correlation failed. Error in staging sever

NithinBolishetti 0 Reputation points
2023-12-20T05:45:54.72+00:00

here is my error log:

1  ERRORMicrosoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware
An unhandled exception has occurred while executing the request. 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.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
Developer technologies ASP.NET ASP.NET Core
{count} votes

1 answer

Sort by: Most helpful
  1. Crystal Lee Morgan 380 Reputation points
    2023-12-20T17:55:55.7466667+00:00

    @NithinBolishetti

    The error message you are seeing is related to the correlation cookie in ASP.NET Core Google Authentication. The correlation cookie is used to prevent cross-site request forgery (CSRF) attacks. The error message indicates that the correlation cookie was not found or was invalid.

    To resolve this issue, you can try the following solutions:

    Clear Cookies: Clear the cookies in your browser and try again.

    Check Cookie Settings: Ensure that the cookie settings in your application are correct. You can check this by navigating to the ConfigureServices method in your Startup.cs file and verifying that the cookie settings are correct.

    Check Redirect URI: Ensure that the redirect URI in your Google API Console is correct. You can check this by navigating to the Google API Console and verifying that the redirect URI matches the one in your application.

    Check Correlation Cookie: Ensure that the correlation cookie is being set correctly. You can check this by adding a breakpoint in your code and verifying that the correlation cookie is being set correctly.

    If none of these solutions work, you can try contacting Google support for further assistance. I hope this helps!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.