• anujverma@nextplane.net
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I'm following this tutorial:

https://na6.salesforce.com/help/doc/en/remoteaccess_oauth_web_server_flow.htm

 

When I get to the final step - requesting the auth token - I always get an undocumented "unsupported_grant_type" message. Seems like this is some kind of generic error message, but I can't get around it.

 

I correctly retrieve a code form the initial GET request. Fine.

I generate a POST using that code:

 

POST /services/oauth2/token HTTP/1.0 Host: login.salesforce.com User-Agent: Drupal (+http://drupal.org/) Content-Length: 300 grant_type=authorization_code&code=aPrxVyeZrusRBnc3MMnY7pNlQsARBRDqXQTQ12UzEIDjUBJjlgXOq4_IUp.9E3k%3D&client_id=XXXXXXXXXXXXX&client_secret=XXXXXXXXXXXXX&redirect_uri=https%3A%2F%2Flocalhost%2FRestTest%2Fsalesforce%2Foauth

 

And the response is always the same:

 

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

 

Everything is properly url encoded, and I've followed the directions to a T.

Any ideas?