0

Is it possible to log a Communities user in via the Username-Password Auth Flow? With normal users you can call the http://test.salesforce.com/services/oauth2/token and passing the username, password, client id, client secret and grant type you can get an access token back. So would the communities version of this url be https://<MySandbox>.cs14.force.com/<CommunityName>/services/oauth2/token

1

Yes you need to change the base URL to make it working. Here is a sample URL for you.

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

The authorization service will recognize the custom hostname and further redirect the user to the Site login page, assuming the user is not yet authenticated. Note – if your site uses a path as well as the site domain, for example, https://mysite.secure.force.com/mypath, you will need to include that path in the authorization URL:

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

OAuth for Portal Users

  • This is what I am currently using, but the redirect is not the desired result. I was hoping to just get an access token like you can for normal users, and then use that token in subsequent calls. – user40646 Sep 13 '17 at 9:12

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.