.net core 在.Net Core 3.1中使用多重(JWT和Google)身份验证来授权控制器
这是startup.cs类,用于对google和本地jwt身份验证进行身份验证和授权。.net core 在.Net Core 3.1中使用多重(JWT和Google)身份验证来授权控制器,.net-core,google-authentication,jwt-auth,.net-core-3.1,social-authentication,.net Core,Google Authentication,Jwt Auth,.net Core 3.1,Social Authentication,这是startup.cs类,用于对google和本地jwt身份验证进行身份验证和授权。 services.AddAuthentication() .AddJwtBearer(options => { options.TokenValidationParameters = new TokenValidationParameters { Va
services.AddAuthentication()
.AddJwtBearer(options =>
{
options.TokenValidationParameters = new TokenValidationParameters
{
ValidateIssuer = false,
ValidateAudience = false,
ValidateLifetime = true,
ValidateIssuerSigningKey = true,
ValidIssuer = "https://localhost:44310",
ValidAudience = "https://localhost:44310",
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(privateSecretKey))
};
})
.AddGoogle(options =>
{
options.ClientId = "978209633876-494rboetnlq1pqh56moboa3t0q812oe8.apps.googleusercontent.com";
options.ClientSecret = "myv6PN12F5jLQTs26vVomGUg";
});
你的问题是什么?