C# 如何设置重定向uri登录google.Net Core 2,Docker
我正在尝试使用.NETCore2中的google进行身份验证,dockerC# 如何设置重定向uri登录google.Net Core 2,Docker,c#,.net,docker,.net-core,C#,.net,Docker,.net Core,我正在尝试使用.NETCore2中的google进行身份验证,docker services .AddAuthentication(options => { options.DefaultSignOutScheme = IdentityConstants.ApplicationScheme; options.DefaultAuthenticateScheme = CookieAu
services
.AddAuthentication(options =>
{
options.DefaultSignOutScheme = IdentityConstants.ApplicationScheme;
options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;
})
.AddGoogle("Google", options =>
{
options.CallbackPath = "/api/i/v1/identity/handle-external-login/Google/callback";
options.ClaimActions.MapJsonKey("urn:google:picture", "picture", "url");
options.ClaimActions.MapJsonKey("urn:google:locale", "locale", "string");
options.SaveTokens = true;
options.ClientId = Configuration["Authentication:Google:ClientId"];
options.ClientSecret = Configuration["Authentication:Google:ClientSecret"];
options.Events = new OAuthEvents
{
OnRemoteFailure = (RemoteFailureContext context) =>
{
context.Response.Redirect("/home/denied");
context.HandleResponse();
return Task.CompletedTask;
}
};
})
重定向到google登录页面时:
400. That’s an error.
Error: invalid_request
Invalid parameter value for redirect_uri: Non-public domains not allowed: http://identity.service/api/i/v1/identity/handle-external-login/Google/callback
如何将identity.service更改为localhost或其他内容?
对不起,我的英语不好,您(大概)正在访问
http://identity.service/signin-google
?使用Google方法访问登录中的重定向URL
变量中的值是多少?@ChetanRanpariya”/api/v1/identity/handle external login/Google/callback
400. That’s an error.
Error: invalid_request
Invalid parameter value for redirect_uri: Non-public domains not allowed: http://identity.service/api/i/v1/identity/handle-external-login/Google/callback