I have been following this trailhead to allow users login in a community using facebook:
https://trailhead.salesforce.com/en/modules/identity_external/units/identity_external_social
I dont want them to register, I only need they will be able to login. To get this I have modified the SF automatic handler.
global class SimpleFacebookRegistrationHandler implements Auth.RegistrationHandler{
global User createUser(Id portalId, Auth.UserData data){
List<User> listUsers = [SELECT Id FROM User WHERE UserName = :data.email AND Profile.Name = :ProfileHelper.COMMUNITY_PROFILE LIMIT 1];
if(listUsers.isEmpty()){
return null;
}else{
return listUsers[0];
}
}
global void updateUser(Id userId, Id portalId, Auth.UserData data){}
}
So then I go to the link provided by SF in the corresponding "Auth Providers" section, log in with FB and get the next error: "No access: User was a portal user"
What am I missing? Well, it is pretty obvious that the user was a portal user but if I can login using the "normal login" why I get this error being logged using facebook?