Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# IdentityServer3登录后SSO如何从FB获取用户数据(FB用户的电子邮件)_C#_Facebook_Api_Facebook Graph Api_Identityserver3 - Fatal编程技术网

C# IdentityServer3登录后SSO如何从FB获取用户数据(FB用户的电子邮件)

C# IdentityServer3登录后SSO如何从FB获取用户数据(FB用户的电子邮件),c#,facebook,api,facebook-graph-api,identityserver3,C#,Facebook,Api,Facebook Graph Api,Identityserver3,这是我对IdentityServer3的调用,服务器将我重定向到FB登录。当我将数据输入FB登录时,我返回 https://localhost/connect/authorize?client_id=myclientId&redirect_uri=https%3A%2F%2Fredirect.local.com2F&response_type=id_token token&scope=openid profile email&state=dxpwzfvsdorcp

这是我对IdentityServer3的调用,服务器将我重定向到FB登录。当我将数据输入FB登录时,我返回

https://localhost/connect/authorize?client_id=myclientId&redirect_uri=https%3A%2F%2Fredirect.local.com2F&response_type=id_token token&scope=openid profile email&state=dxpwzfvsdorcprdw&nonce=00000000000000000000000000000000&acr_values=idp%3AFacebook
然后我想用令牌连接到FBAPI

id_token=xxx, access_token=xxx, token_type=Bearer, expires_in=360,
scope=openid, state=dxpwzfvsdorcprdw, session_state=z6LgN2QW-BcvaPK2U4-VN_N2L_XlXGMhF8FUT5mXm6M.7ad2e65fb56117dd4db5174802d6ef05
但是我回来了

https://graph.facebook.com/me?access_token=xxx
"message": "Invalid OAuth access token.",
如果我将令牌类型保存到JWT,那么我将返回

https://graph.facebook.com/me?access_token=xxx
"message": "Invalid OAuth access token.",

我做错了什么?

我看到您有“&scope=openid profile email”,当从facebook重定向回来时,它实际上应该会给您声明中的电子邮件。你确定你没有收到吗?是的,我确定。它不包含在JWT中。如果直接在收到访问令牌后,通过调试器运行它,您会看到什么?