Asp.net core mvc MVC核心Google外部提供程序登录任务超时
我需要在MVC Core 5中实现Google外部提供程序方面的一些帮助: 我刚刚在我的项目中添加了谷歌外部提供商,一切都很好,但有些事情是错误的! 以下是我在代码中的操作以及问题描述:Asp.net core mvc MVC核心Google外部提供程序登录任务超时,asp.net-core-mvc,timeout,httpclient,google-signin,google-authentication,Asp.net Core Mvc,Timeout,Httpclient,Google Signin,Google Authentication,我需要在MVC Core 5中实现Google外部提供程序方面的一些帮助: 我刚刚在我的项目中添加了谷歌外部提供商,一切都很好,但有些事情是错误的! 以下是我在代码中的操作以及问题描述: startup.cs : services.AddIdentity<User, Role>(config => { config.User.RequireUniqueEmail = true;
startup.cs :
services.AddIdentity<User, Role>(config =>
{
config.User.RequireUniqueEmail = true;
config.Password.RequireDigit = true;
config.Password.RequireLowercase = true;
config.Password.RequireNonAlphanumeric = false;
config.Password.RequireUppercase = true;
config.Password.RequiredLength = 6;
config.Lockout.AllowedForNewUsers = true;
config.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromMinutes(5);
config.Lockout.MaxFailedAccessAttempts = 3;
})
.AddErrorDescriber<CustomIdentityErrorDescriber>()
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddDefaultTokenProviders();
services.AddAuthentication()
.AddGoogle("google", opt =>
{
var googleAuth = _config.GetSection("GoogleExternalSignIn");
opt.ClientId = googleAuth["ClientId"];
opt.ClientSecret = googleAuth["ClientSecret"];
opt.SignInScheme = IdentityConstants.ExternalScheme;
//opt.BackchannelTimeout = new TimeSpan(0, 5, 0);
})
;
我试图设置opt.BackchannelTimeout=newtimespan(0,5,0)
在AddGoogle配置中,但在尝试登录5分钟后,它返回上述异常。
我怎样才能解决它?
问题在哪里
System.Threading.CancellationToken.ThrowOperationCanceledException()
TimeoutException: The operation was canceled.
System.Threading.CancellationToken.ThrowOperationCanceledException()
TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 300 seconds elapsing.
System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, bool async, bool emitTelemetryStartStop, CancellationToken cancellationToken)
Exception: An error was encountered while handling the remote login.