I would like to use multiple sign-in capabilities for my webapi. I now have a working JWT option for registering / login-in using email / password. Now i would also like to add Google Authentication but am lost how to combine the two.
code for JWT in Startup.CS / ConfigureServices;
// configure jwt authentication
var key = Encoding.ASCII.GetBytes(appSettings.Secret);
services.AddAuthentication(x =>
{
x.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
x.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
})
.AddJwtBearer(x =>
{
x.RequireHttpsMetadata = false;
x.SaveToken = true;
x.TokenValidationParameters = new TokenValidationParameters
{
ValidateIssuerSigningKey = true,
IssuerSigningKey = new SymmetricSecurityKey(key),
ValidateIssuer = false,
ValidateAudience = false
};
})
How would i add the Google authentication here so i can use both?