【发布时间】:2020-12-07 13:27:54
【问题描述】:
我在 ASP.NET Core 应用程序中配置了身份服务器 4。除了打开和配置文件范围外,我还希望获得登录用户的生日作为声明。我对以下配置没有运气
services.AddAuthentication(IdentityServerAuthenticationDefaults.AuthenticationScheme)
.AddFacebook(options =>
{
options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme;
options.AppId = "XXX";
options.AppSecret = "XXX";
options.SaveTokens = true;
options.Scope.Add("user_birthday");
options.Fields.Add("birthday");
})
知道为什么这不起作用吗?
OIDC 客户端请求配置
var config = {
authority: "https://localhost:44330",
client_id: "ff-client",
redirect_uri: "https://localhost:5003/callback.html",
response_type: "id_token token",
scope:"openid profile gateway identity",
post_logout_redirect_uri: "https://localhost:5003/index.html",
acr_values: "idp:Facebook",
loadUserInfo: true,
};
【问题讨论】:
-
什么不起作用?
-
你遇到什么错误了吗?尝试使用F12开发者工具查看是否有错误,也可以查看http响应是否包含生日?这里有一篇关于Retrieve User Details From Facebook In ASP.NET Core Applications的文章,希望对你有所帮助。
标签: asp.net-core identityserver4 facebook-oauth