• Xpario Administrator
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

hi,

 

My mobile app login to salesforce org using the ouath username/password flow before and work fine. Related document:

https://help.salesforce.com/help/doc/en/remoteaccess_oauth_username_password_flow.htm

 

But now the situation changes!  I need to change the user from standard user to communities user.  I've setup the communities and created a new communities user in SFDC.  I can login to the communities in https://[my-communities-domain].force.com/[my-communities-name]/login without any problem.

 

And then I read the instruction on page 32-34 of following document and try to login with chatter api instead, as the new user is a communities user.

http://www.salesforce.com/us/developer/docs/chatterapi/salesforce_chatter_rest_api.pdf

 

curl --form client_id=[my client id] --form client_secret=[my client secret] --form grant_type=password --form username=[username@some.domain] --form password=[user password] https://[my-communties-domain].force.com/[my-communities-name]/services/oauth2/token 

 

It fails and responds with json string:

 

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

 

 

I also try to add header with different content type but same error report.

-H "content-type: application/x-www-form-urlencoded"

 

 

The sample curl of login api in the chatter rest api document page 34:

 

curl --form client_id=3MVG9PhR6g6B7ps4xDycwGrI4PvjVZvK9
--form client_secret=8870355475032095511
--form grant_type=password
--form username=admin@seattleapps.com
--form password=1Lsfdc!
https://communitydomain.force.com/communitypath/services/oauth2/token

 

Regards,

Billy Lo

  • August 19, 2013
  • Like
  • 1