0

I need to do a login of our customer portal users in a mobile app (not using mobile SDK), for authenticating internal users it's working the REST API but for the Customer Portal Users is not.

The body:

username="Username"&client_secret="Secret From Connected App"&password="Password"&grant_type=password&client_id="Client ID from Connected App"

What I need to do to make this work? Is there any guide?

0

I worked through a similar situation. I'm assuming that you are using OAuth, and in a nutshell it boils down the login URL. Internal Users are naturally going to login.salesforce.com, but your portal User are going to have to go to the Site Login URL. Here's the link to the article from that got me going, and here's the excerpt that's at the heart of it.

The first step in enabling OAuth for your Portal users is to associate a Force.com Site with your Portal, if you have not already done so. The Site provides your Portal with a unique URL and allows you to create a custom login page. Apps that wish to login users for the Portal must use the hostname from the Site’s secure URL when redirecting users to the OAuth 2.0 authorization service. For example, rather than redirecting to

https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=your_client_id&redirect_uri=your_redirect_uri

instead use

https://mysite.secure.force.com/services/oauth2/authorize?response_type=code&client_id=your_client_id&redirect_uri=your_redirect_uri

  • I was looking for a way to mention @metadaddy in my answer... he wrote the article (thanks Pat!) and deserved the credit, but couldn't figure out how to! – John Thompson Apr 20 '17 at 19:47
  • Hello @John, thank you, I found the same article after a deep research, in our case, we don't use the Portal, so we can make the login with the SOAP using just the orgId. – Thiago Balancin Apr 20 '17 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.