0

I have a Django application which connects to Salesforce using some user informed credentials and an user informed Salesforce record ID. But I don't want my users accessing an external system anymore, so I need to make Salesforce connect to this external system and give this record ID and credentials instead. But I can't modify the existing system, so I need to put user's username, password and token as POST parameters when making the callout.

I couldn't find any UserInfo.getPassword() or similar functions to get running user's credentials to add in the body for the callout. How is that possible?

EDIT: By using Named Credentials, I can access {!$Credentials.UserName} and {!$Credentials.Password} and insert them in the POST body, but I couldn't find any way to get the API Token. Is there any way? My external system needs these 3 credentials to be able to do his thing. I know it would be best to have a different endpoint which does not require this information, but right now I don't have the option to create another service.

2
  • There are many other answers to questions than the ones indicated that are associated with authenticating to an external service. HttpRequest and Named Credentials are the main ways. If you have a more specific question please modify your question and the community will most likely reopen and answer it. How to Ask
    – Eric
    Commented May 30, 2017 at 17:22
  • Hi Eric, thank you for pointing out similar questions, but in fact I need a more specific answer and I have already edited my post to reflect it. Commented May 30, 2017 at 20:14

0

Browse other questions tagged .