{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Security/issues/435","repository_url":"https://api.github.com/repos/aspnet/Security","labels_url":"https://api.github.com/repos/aspnet/Security/issues/435/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Security/issues/435/comments","events_url":"https://api.github.com/repos/aspnet/Security/issues/435/events","html_url":"https://github.com/aspnet/Security/issues/435","id":104964845,"number":435,"title":"Can't get email claim from Facebook","user":{"login":"MikeWasson","id":3992422,"avatar_url":"https://avatars.githubusercontent.com/u/3992422?v=3","gravatar_id":"","url":"https://api.github.com/users/MikeWasson","html_url":"https://github.com/MikeWasson","followers_url":"https://api.github.com/users/MikeWasson/followers","following_url":"https://api.github.com/users/MikeWasson/following{/other_user}","gists_url":"https://api.github.com/users/MikeWasson/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeWasson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeWasson/subscriptions","organizations_url":"https://api.github.com/users/MikeWasson/orgs","repos_url":"https://api.github.com/users/MikeWasson/repos","events_url":"https://api.github.com/users/MikeWasson/events{/privacy}","received_events_url":"https://api.github.com/users/MikeWasson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aspnet/Security/labels/3%20-%20Done","name":"3 - Done","color":"CCCCCC"},{"url":"https://api.github.com/repos/aspnet/Security/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"Tratcher","id":1821173,"avatar_url":"https://avatars.githubusercontent.com/u/1821173?v=3","gravatar_id":"","url":"https://api.github.com/users/Tratcher","html_url":"https://github.com/Tratcher","followers_url":"https://api.github.com/users/Tratcher/followers","following_url":"https://api.github.com/users/Tratcher/following{/other_user}","gists_url":"https://api.github.com/users/Tratcher/gists{/gist_id}","starred_url":"https://api.github.com/users/Tratcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tratcher/subscriptions","organizations_url":"https://api.github.com/users/Tratcher/orgs","repos_url":"https://api.github.com/users/Tratcher/repos","events_url":"https://api.github.com/users/Tratcher/events{/privacy}","received_events_url":"https://api.github.com/users/Tratcher/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/aspnet/Security/milestones/14","html_url":"https://github.com/aspnet/Security/milestones/1.0.0-rc2","labels_url":"https://api.github.com/repos/aspnet/Security/milestones/14/labels","id":1367318,"number":14,"title":"1.0.0-rc2","description":null,"creator":{"login":"Eilon","id":202643,"avatar_url":"https://avatars.githubusercontent.com/u/202643?v=3","gravatar_id":"","url":"https://api.github.com/users/Eilon","html_url":"https://github.com/Eilon","followers_url":"https://api.github.com/users/Eilon/followers","following_url":"https://api.github.com/users/Eilon/following{/other_user}","gists_url":"https://api.github.com/users/Eilon/gists{/gist_id}","starred_url":"https://api.github.com/users/Eilon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eilon/subscriptions","organizations_url":"https://api.github.com/users/Eilon/orgs","repos_url":"https://api.github.com/users/Eilon/repos","events_url":"https://api.github.com/users/Eilon/events{/privacy}","received_events_url":"https://api.github.com/users/Eilon/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":75,"state":"open","created_at":"2015-10-20T22:41:25Z","updated_at":"2016-04-01T22:13:50Z","due_on":null,"closed_at":null},"comments":15,"created_at":"2015-09-04T20:31:28Z","updated_at":"2016-04-14T16:41:46Z","closed_at":"2015-12-02T18:48:15Z","body":"Using beta7 packages. In my startup:\r\n\r\n            services.Configure<FacebookAuthenticationOptions>(options =>\r\n            {\r\n                options.AppId = Configuration[\"Authentication:Facebook:AppId\"];\r\n                options.AppSecret = Configuration[\"Authentication:Facebook:AppSecret\"];\r\n                options.Scope.Add(\"email\");\r\n            });\r\n\r\nHowever, inside AccountController.ExternalLoginCallback, I get back these claim types in the ExternalPrincipal:\r\n\r\n- \"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier\"\r\n- \"urn:facebook:name\"\r\n- \"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name\"\r\n\r\nIn the Fiddler traffic, I can see that it’s calling the FB Graph API and getting:\r\n\r\n    {\"name\":\"xxx\",\"id\":\"xxxx\"}\r\n\r\nIf I modify the request to ask for email and replay it, then I do get the email, so I think my scope is correct\r\n\r\n    GET https://graph.facebook.com/v2.2/me?fields=id,name,email&access_token=blah\r\n\r\nResponse:\r\n\r\n    {\"id\":\"xxx\",\"name\":\"xxxx\",\"email\":\"xxx\"}\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/Security/issues/comments/210042048","html_url":"https://github.com/aspnet/Security/issues/435#issuecomment-210042048","issue_url":"https://api.github.com/repos/aspnet/Security/issues/435","id":210042048,"user":{"login":"gdoron","id":6141009,"avatar_url":"https://avatars.githubusercontent.com/u/6141009?v=3","gravatar_id":"","url":"https://api.github.com/users/gdoron","html_url":"https://github.com/gdoron","followers_url":"https://api.github.com/users/gdoron/followers","following_url":"https://api.github.com/users/gdoron/following{/other_user}","gists_url":"https://api.github.com/users/gdoron/gists{/gist_id}","starred_url":"https://api.github.com/users/gdoron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdoron/subscriptions","organizations_url":"https://api.github.com/users/gdoron/orgs","repos_url":"https://api.github.com/users/gdoron/repos","events_url":"https://api.github.com/users/gdoron/events{/privacy}","received_events_url":"https://api.github.com/users/gdoron/received_events","type":"User","site_admin":false},"created_at":"2016-04-14T16:41:45Z","updated_at":"2016-04-14T16:41:45Z","body":"@Tratcher \r\nHi Chris, I'm posting here after a day or two of searching the web and Stack Overflow for solution for this one. :cry: \r\n\r\n(We are using RC1-final, and can't upgrade to RC2 until there will be VS tooling support for RC2)\r\n\r\nI'm using the same code suggested earlier by @Jayman1305 to get the *first_name*, *last_name*, *email* and *significant_other* of the user:\r\n\r\n\tapp.UseFacebookAuthentication(options =>\r\n\t            {\r\n\t                options.AppId = Configuration[\"Authentication:Facebook:AppId\"];\r\n\t                options.AppSecret = Configuration[\"Authentication:Facebook:AppSecret\"];\r\n\t                options.Scope.Add(\"email\");\r\n\t                options.Scope.Add(\"user_relationships\");\r\n\t                options.BackchannelHttpHandler = new HttpClientHandler();\r\n\t                options.UserInformationEndpoint = \r\n\t                    \"https://graph.facebook.com/v2.5/me?fields=id,email,first_name,last_name,significant_other\";\r\n\r\nThis solution indeed returns the email of the user, but fails with first_name,last_name and significant_other (and any other field I tried besides *name*, *id* and *email*).\r\n\r\nAlso, is it possible getting the FB access token? We might need it for future querying of other edges.\r\n\r\nI need a way, even if not the cleanest, to get this information on RC1.\r\n\r\nMany thanks."}}