• Priyankar Pakhira 23
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi

I am going to do Single Sign On setup through OPEN ID connect with Google+. Wheras Salesforce is acting as a Service Provider and Google as a Identity Provider. Now when I am trying to login through Salesforce it redirects me to Google Account but after Submitting the google credential it is throwing below error

We can’t log you in because of the following error. For more information, contact your Salesforce administrator.
Missing_Value: Could not find unique third-party identifier


Please can you let me know if I am  doing anything wrong. Please find below the Registration Handler class below

global class GoogleEnterpriseSignOn implements Auth.RegistrationHandler{

global boolean canCreateUser(Auth.UserData data) {
  if(data.email!=null) // this null checking is just for demo purpose
  {
      return true;
  }
  else
  {
      return false;
  }
}

global User createUser(Id portalId, Auth.UserData data){

    if(canCreateUser(data))
    {
        List<User> users = [select Id from User where Google_ID__c=:data.identifier];
        if(users.size()==1)
        {
            system.debug('#1##'+users[0]);
            return users[0];
        }
        else
        {
            User u = new User();
            Profile p = [SELECT Id FROM profile WHERE name='System Administrator'];
            u.username = data.email.substring(0,data.email.indexOf('@'))+ '@sso.com';
            u.email = data.email;
            u.lastName = data.lastName;
            u.firstName = data.firstName;
            String alias = data.firstName.substring(0,1)+data.lastName.substring(0,4);
            if(alias.length() > 8) {
                alias = alias.substring(0, 8);
            }
            u.alias = alias;
            u.languagelocalekey = 'en_US';
            u.localesidkey = 'en_US';
            u.emailEncodingKey = 'UTF-8';
            u.timeZoneSidKey = 'America/Los_Angeles';
            u.profileId = p.Id;
            u.Google_ID__c = data.identifier;
            System.debug('+++++'+u);
            insert u;
            return u;
        }
    }
    else
    {
        return null;
    }
}

global void updateUser(Id userId, Id portalId, Auth.UserData data){
    User u = new User(Id=userId);
    u.Google_ID__c = data.identifier;
    update u;
}
}

 
Visualforce allows us to render the page as a pdf thanks to the renderas attribute of the page tag. However, I have noticed some inconsistancies between the pdf render and the vf page render. The inconsistancy I am most concerned about at the moment is font types. I styled an outputtext tag with "font-family:arial;". This works for the vf page, but not the pdf. I have tried a number of methods to change the font in the pdf version but to no avail.
Any ideas?