function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
guyLeadSpaceguyLeadSpace 

Application Installation process

Hi All

 

I have a server side application and a client side application I wrote in salesforce.

 

In order my server will get data from the user's salesforce, I need the user's token and password.

 

Is there any way, after the user installs my salesforce app, to send the user's personal data (name, email) and token and password to my server.

 

Without forcing the user to some "register" button, that sends the data to my server.

 

I don't want to force the user, after the app installation, to do more registration steps..

 

Can I avoid it by any way???

 

Thanks in advance

guy

jesperfjjesperfj

What is the exact use case for why you need to do this? You may be able to use oauth, although it might not give you exactly the experience you have in mind and it might not work at all. But it would be interesting to understand why you would want a user's credentials to be sent from Salesforce to an external system. This is basically a big no no.

 

Regards,

Jesper

 

guyLeadSpaceguyLeadSpace

After your big no no, I did more research and I found out that I can use the user's SessionId to login through the API,

is that correct??

 

If, for instance, I want to insert data, does it matter if the user has the right security privileges??

 

Can you, please, point me to a code that shows how to login only with SessionId

 

thank you for your help

guy

jesperfjjesperfj

Using sessionId is the right way. Anything you do with a sessionId issued for a user will be subjected to the security policy for that user.