Home > Blockchain >  How can I catch response after third-party login-in with Google?
How can I catch response after third-party login-in with Google?

Time:11-09

I want to implement Google login logic without Identity realization.
I am using .net 6 web API.

I base my logic on article enter image description here

But then a authorization the request go to wrong API endpoint. It has to go 'Google/Challenge' endpoint

enter image description here

I can't understand why it goes to signin-google and doesn't response to challenge endpoint?

Front-end side is Vue3 js. There is a link to login endpoint

<a href="http://localhost:56895/Google/Login">Sign up with Google</a>

I tried to send the request and catch callback but unfortunatelly I didn't recieve it

CodePudding user response:

"Correlation failed" issues are often caused by misconfigured cookies for SameSite.

This can typically be resolved by updating the configuration in your ConfigureServices() (or similar) method.

services.Configure<CookiePolicyOptions>(options =>
{
    options.MinimumSameSitePolicy = SameSiteMode.Unspecified;
    options.OnAppendCookie = ctx => SetSameSite(ctx.CookieOptions);
    options.OnDeleteCookie = ctx => SetSameSite(ctx.CookieOptions);
});

static void SetSameSite(CookieOptions options)
{
    if (options.SameSite == SameSiteMode.None)
    {
        options.SameSite = SameSiteMode.Unspecified;
    }
}

The above snippet was adapted from this GitHub issue.

  • Related