0

I have a rails app connecting to Salesforce through restforce gem. I am trying to map Rails users with Salesforce contact records—so when they log in to my rails app it pulls the record from Salesforce. What will be the best way to do this?

For example, I have devise installed for user authentication.

Scenario 1 - Mapping New Rails User to Existing Salesforce Contact Rails app: John is User1 has an id of "001" and email of "[email protected]" Salesforce: John is an existing Contact1 and has Contact ID of "003C000001lniUd" and email of "[email protected]"

How to map these two, so Rails user John can see only his record from Salesforce Contact? It seems like only way is to connect the dot is through email, but our database might have few Contact records with "[email protected]" in Salesforce.

Scenario 2 - Mapping New Rails User to Create New Salesforce Contact and Mapping the two Rails app: New User2 is created in Rails app with an id of "0001" with an email "[email protected]"

How to check if there is not duplicate in Salesforce?

I hope this is making sense... Any advice is welcomed. Thanks.

3
  • 2
    The risk to watch out for here is that a Rails user gets access to existing Salesforce data that belongs to someone else. So the simple and safe approach is that when a new Rails user is created a corresponding new Salesforce Contact is also created (with the two related by adding the Rails id field as a custom field that is not editable by most users to the Salesforce Contact). Otherwise it gets more complicated. Relating identities in two different systems is awkward, but sending email - relying on only the right person being able to access the email - as part of the process is one strategy.
    – Keith C
    Commented Nov 22, 2014 at 10:41
  • How would you recommend mapping the existing rails users to existing Salesforce contact? Commented Nov 26, 2014 at 22:12
  • 1
    You will need a piece of data in common and an email address is a reasonable choice because systems (including Salesforce) rely on only one person having access to emails sent to that an email address. So if you've sent access confirming emails (where the person has to reply) from both the Rails system and from Salesforce, its not too unreasonable to assume that its the same person on both systems.
    – Keith C
    Commented Nov 26, 2014 at 22:26

0

You must log in to answer this question.

Browse other questions tagged .