• blo
  • NEWBIE
  • 0 Points
  • Member since 2013

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

I want to use username/password oauth flow to login as a Communities user.  Anyone know how to do that?

 

I had done the same oauth for the standard user in other projects without any problem.  The oauth request was similar to this:

 

curl 
--form grant_type=password 
--form client_id=[my_client_id]
--form client_secret=[my_client_secret]
--form username=[username]
--form password=[password]
 
For communities user login, I change the url to https://[communitites subdomain].force.com/[communities name]/services/oauth2/token and it always return error message:
 

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

 

Please help.  Thanks.

  • November 21, 2013
  • Like
  • 0

hi,

 

We use new Customer Communities licenses, and the customers will be accessing the app through a native mobile
app(android and iOS).  We were told there was API access for communities but we have problem during logging into SFDC via Chatter API with Communities User's uname/password.  The document we refer to is http://www.salesforce.com/us/developer/docs/chatterapi/

The login fail error is {"error":"unsupported_grant_type","error_description":"grant type not supported"}.  The communities licenses user can login to the communities via browser but fail with OAuth.


Please help.

  • August 20, 2013
  • Like
  • 0

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?

 

 

  • August 20, 2013
  • Like
  • 0

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

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

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?

 

 

  • August 20, 2013
  • Like
  • 0