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
bloblo 

Can Communities user accees custom object?

hi, 

 

The new communities seems good for business to customer purpose app.   And the document said it supports up to 10 custom objects per license.  

 

Salesforce Communities are designed to scale to millions of users combining branding, Chatter, access to objects and workflow, enterprise-level administration and sharing capabilities.

refer to http://www.axxissolutions.com/salesforce-communities-get-better-in-summer-13-release/

 

My question is, can the communities user also access custom object externally?  I wanna login from my own mobile app(a custom ios app) to SFDC via the username/password auth flow, and then access custom object records but it fail in the auth request with unsupported_grant_type error.  I also try login via chatter rest api(with my communities endpoint) but it fails with same error too.  

 

Do I miss something important?  Or does anything different between the standard user and communities user in the username/password login flow?

 

 

wt35wt35

When you say "username/password auth flow", do you mean you login manually?

 

In any case that is the solution for oAUth SAML assertion flow:

 

Description
Reason for this error is because without the right content-type being set in the HTTP header, the server cannot decode the form values, and so server thinks the first parameter it checks is not set
Resolution
To fix this issue, please set  Content-Type header to "'application/x-www-form-urlencoded". Make sure to URL encode all the values sent in the POST body

Example Assertion with Headers:

POST /services/oauth2/token HTTP/1.1
Host: login.salesforce.com
Content-Type: application/x-www-form-urlencoded

grant_type=assertion&assertion_type=
urn%3Aoasis%3Anames%3Atc%3ASAML%3A2.0%3Aprofiles%3ASSO%3Abrowser&
assertion=PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHNhbW. . .

 

bloblo

Thanks a lot for your reply.

 

Actually I follow this document to do the auth process: http://www.salesforce.com/us/developer/docs/chatterapi/

 

I test the login flow using curl:

curl -H "Content-Type: application/x-www-form-urlencoded" --form grant_type=password --form client_id=my_client_id --form client_secret=my_client_secret --form username=communities_user_name --form password=communities_user_password https://[communities-domain].force.com/[communities-name]/services/oauth2/token -v

 

Response back with status 400 Bad Request

{"error":"unsupported_grant_type","error_description":"grant type not supported"}