Googe Authentication from .net Core not hitting my CallBackPtah that i have set in Startup Class

37 views Asked by At

While working on Google Authentication from .net Core Api am facing an issue. In .net core , After successful authentication from google, it does not hitting CallBackPath that I have set in Startup Class under the app.UseGoogleAuthentication.

If I am not setting the CallBackPath in startup class then it takes "signin-google" by default. How can I handle this call back? My StartUp Class-

// Adds a cookie-based authentication middleware to application

app.UseCookieAuthentication(new CookieAuthenticationOptions { LoginPath = new PathString("/account/login"), AuthenticationScheme = "MyCookieMiddlewareInstance", AutomaticAuthenticate = true, AutomaticChallenge = true, AccessDeniedPath = new PathString("/Home/AccessDenied"),

        });

// Plugin Google Authentication configuration options

app.UseGoogleAuthentication(new GoogleOptions { AuthenticationScheme = "Google", DisplayName = "Google", SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme, ClientId = "Google ClientId", ClientSecret = "Google ClientSecret", Scope = { "email", "openid" }, AutomaticAuthenticate = true, AutomaticChallenge = true, CallbackPath = new PathString("api/values/1") });

0

There are 0 answers