I have created a CustomUserSession class. In this class I override OnAuthenticated (like in the SocialBootstapAPI).
I have code like the following:
var appSettings = authService.TryResolve<IAppSettings>();
var userAuthRepo = authService.TryResolve<IAuthRepository>();
var userAuth = userAuthRepo.GetUserAuth(session, tokens);
var dbConnectionFactory = authService.TryResolve<IDbConnectionFactory>();
foreach (var authTokens in session.ProviderOAuthAccess)
{
if (authTokens.Provider == FacebookAuthProvider.Name)
{
...
If I check authTokens I find that I can get id, email, first_name, last_name, username (same as id) and Display Name (which is First and last name). I added permissions and I do get the correct prompt from Facebook based on those permissions:
<add key="oauth.facebook.Permissions" value="email,public_profile,user_about_me,user_birthday,user_location" />
but when I check authTokens I still only have data for id, email, first_name, last_name, username.
In the Facebook oath provider you have:
public static string[] DefaultFields = { "id", "name", "first_name", "last_name", "email" };
it seems to be the only fields that are ever returned.
I tried to figure out how to set this property. It seems like:
<add key="oauth.facebook.Fields" value="id,name,first_name,last_name,email,cover,name,age_range,link,gender,locale,picture,timezone,updated_time,verified" />
should work based on the way the other properties are set, but that actually seems to keep it from working at all.
I tried to figure out how to set that property in code but I don’t think I set it in the right place.
I tried this against my personal Facebook account where the majority of those fields contain data.