+ Start a Discussion
Dream_weaverDream_weaver 

Configuring a Facebook Authentication Provider

I tried to set up facebook authentication provider using the steps mentioned in the link below

 

http://help.salesforce.com/HTViewHelpDoc?id=sso_provider_facebook.htm&language=en_US#facebook_define

 

used the follwing apex class as Registration Handler  class

 

global class StandardUserRegistrationHandler implements Auth.RegistrationHandler{
global User createUser(Id portalId, Auth.UserData data){
    User u = new User();
    system.debug('Auth.UserData :'+ data);
    Profile p = [SELECT Id FROM profile WHERE name='Customer Portal User'];
    u.username = data.username + '@salesforce.com';
    u.email = data.email;
    u.lastName = data.lastName;
    u.firstName = data.firstName;
    String alias = data.username;
    if(alias.length() > 8) {
        alias = alias.substring(0, 8);
    }
    u.alias = alias;
    u.languagelocalekey = data.locale;
    u.localesidkey = data.locale;
    u.emailEncodingKey = 'UTF-8';
    u.timeZoneSidKey = 'America/Los_Angeles';
    u.profileId = p.Id;
    return u;
}

global void updateUser(Id userId, Id portalId, Auth.UserData data){
    User u = new User(id=userId);
    u.username = data.username + '@salesforce.com';
    u.email = data.email;
    u.lastName = data.lastName;
    u.firstName = data.firstName;
    String alias = data.username;
    if(alias.length() > 8) {
        alias = alias.substring(0, 8);
    }
    u.alias = alias;
    u.languagelocalekey = data.locale;
    u.localesidkey = data.locale;
    update(u);
}
}

 

but the functionality is not working..Infact nothing is coming in debug log also..Has any one ever tried the example ??

tggagnetggagne
Did you figure this out? Did you ever discover how these can be debugged?  I tried debugging the "execute registratio as" user without luck.