This repository was archived by the owner on Dec 13, 2018. It is now read-only.
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
Return givename and surname claims from Facebook provider by default. #688
Closed
Description
I know things are really busy round here so don't spend too much time looking at this. @Tratcher
Its a bit nitty.
If you don't think this is going anywhere please close.
I would like to (re)present my reasons for this.
- We are not really requesting any more information than name already provides but it is very useful to have givenname and surname separated from a programming perspective.
- First name and last name are actually pretty useful for the user site registration process and splitting the full name is not always straight forward e.g. Jesus De Souza
- Facebook and Google are by far the 2 most used social logins. It would be consistent for the providers to return the same set of
http://schemas.xmlsoap.org/ws/2005/05/identity/
claims - New developers that have never seen the source code may take a while to discover they need to add fields to Facebook options to get first_name and last_name (probably save a bit of forum traffic).
- The only impact this will have is a few more bytes in the request and JSON response for Facebook.
- No more permissions are requested to the Facebook end user (the request for info is still within the already requested scope)
- It requires minimal code change to the Facebook options and that is already tested
- It allows a better abstraction from the implementation of the provider to the end user developer.
Currently
Using the social sample and a minimal setup
app.UseGoogleAuthentication(new GoogleOptions
{
ClientId = Configuration["google:clientid"],
ClientSecret = Configuration["google:clientsecret"]
});
Returns
Hello Joe BLogs
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier: 9999999999999999999
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname: Joe
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname: Blogs
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name: Joe Blogs
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress: [email protected]
urn:google:profile: https://plus.google.com/99999999999999999999
Logout
app.UseFacebookAuthentication(new FacebookOptions
{
AppId = Configuration["facebook:appid"],
AppSecret = Configuration["facebook:appsecret"],
});
returns
Hello Joe Blogs
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier: 956866371056181
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress: [email protected]
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name: Joe Blogs
Logout
Would it make sense to add?
Fields.Add("first_name");
Fields.Add("last_name");
To the Facebook options