• robert_clark
  • NEWBIE
  • 0 Points
  • Member since 2010

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

I have been exploring OAuth2/REST and have been partially successful.  Some user accounts can authorize but others can't.

I'm using the password flow and cURL to obtain an authorization token.  The method is outlined here : https://na1.salesforce.com/help/doc/en/remoteaccess_oauth_username_password_flow.htm

Here's an example the command, with ${..} style placeholders for sensitive info.

curl -d grant_type=password&client_id=$(my_client_id}&client_secret=${my_client_secret}&username=${username}&password=${password} https://login.salesforce.com/services/oauth2/token

When it works, it works great - I get back a token and can use it with subsequent REST queries etc.

When it fails (for most of the users) I get this JSON snippet:
{"error":"invalid_grant","error_description":"invalid user credentials"}

The steps to set up REST have all been followed, the users all have API Enabled.  For some users this always works, for others it never works.

Any help would be appreciated.

I have been exploring OAuth2/REST and have been partially successful.  Some user accounts can authorize but others can't.

I'm using the password flow and cURL to obtain an authorization token.  The method is outlined here : https://na1.salesforce.com/help/doc/en/remoteaccess_oauth_username_password_flow.htm

Here's an example the command, with ${..} style placeholders for sensitive info.

curl -d grant_type=password&client_id=$(my_client_id}&client_secret=${my_client_secret}&username=${username}&password=${password} https://login.salesforce.com/services/oauth2/token

When it works, it works great - I get back a token and can use it with subsequent REST queries etc.

When it fails (for most of the users) I get this JSON snippet:
{"error":"invalid_grant","error_description":"invalid user credentials"}

The steps to set up REST have all been followed, the users all have API Enabled.  For some users this always works, for others it never works.

Any help would be appreciated.

Once you retrieve an access token using oauth, how long is it valid? Does it eventually expire?

  • October 30, 2010
  • Like
  • 0