Newer Version Available

This content describes an older version of this product. View Latest

Connecting to Salesforce Communities

To use OAuth to connect to a Salesforce community, replace the server instance name with the full path to the community URL.

To connect to a Salesforce community, you can use the OAuth Web server and user-agent workflows.

To authenticate a user using the authorize URL, replace the login.salesforce.com host name with the full path to the community URL. This is the non-Communities URL:
1https://login.salesforce.com/services/oauth2/authorize?
2response_type=token&client_id=your_app_id&redirect_uri=your_redirect_uris
This is the Communities URL:
1https://acme.force.com/customers/services/oauth2/authorize?
2response_type=token&client_id=your_app_id&redirect_uri=your_redirect_uri
When implemented successfully, this URL directs users to your app’s branded login page. After they authorize the app, set a user access token and a refresh token for future authentication. In requests for the token endpoint, replace the host with the community, like this:
1https://acme.force.com/customers/services/oauth2/token
To request a Chatter REST API resource, use the Salesforce host name and specify the community ID:
1https://na1.salesforce.com/services/data/v29.0/connect
2/communities/communityId/chatter/feeds/news/me/feed-elements
Alternately, you can replace the host name with the full path to the community URL:
1https://communitydomain.force.com/communitypath/services/data/v29.0/connect
2/communities/communityId/chatter/feeds/news/me/feed-elements