The MSDN documentation states that:
GoogleAuthenticationExtensions.UseGoogleAuthentication Method (IAppBuilder)
Note: This API is now obsolete.
What's the alternative? What should be used instead of this method?
You can use the Google OAuth2 middleware like this:
private void ConfigureAuth(IAppBuilder app)
{
var cookieOptions = new CookieAuthenticationOptions
{
LoginPath = new PathString("/Account/Login")
};
app.UseCookieAuthentication(cookieOptions);
app.SetDefaultSignInAsAuthenticationType(cookieOptions.AuthenticationType);
app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions
{
ClientId = ConfigurationManager.AppSettings["ClientId"],
ClientSecret = ConfigurationManager.AppSettings["ClientSecret"]
});
}
You can create a client id and secret at: https://console.developers.google.com/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With