I have been following this trailhead to allow users login in a community using facebook:


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];
            return null;
            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?

1 Answer 1


To others with same problem:

I just had to add


to the link I was using (https://test.salesforce.com/services/auth/sso/.../Facebook) so at the end it worked visiting:


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .