You need to sign in to do that
Don't have an account?
Jeff SV
"expired authorization code" when requesting Access Token
What are possible causes of the error message, "expired authorization code," when requesting an OAuth Access Token?
I'm testing the cookbook code at, "Interact with the Force.com REST API from PHP."
http://developer.force.com/cookbook/recipe/interact-with-the-forcecom-rest-api-from-php
At oauth_callback.php, line 31, I seeing:
- status: 400
- error_uri: expired authorization code
- error: invalid_grant
- error_description: expired authorization code
Thanks.
Hi Jeff - this can happen if you try to retrieve an access token multiple times for the same authorization code - the second and subsequent attempts will fail.
Does anyone have other suggestions for how to resolve this error? I am pretty sure that I am not reusing an old authorization code.
I'm running into the same problem as Jeff when attempting to test out OAuth 2.0 in irb. Here are the basic steps I am taking to try to obtain an access token:
When I attempt to get the access token following the above procedure, I get the error, "expired authorization code".
Never mind... I just re-examined my code and found out that I had a bug where an obsolete variable was being used to provide the auth code instead of what I thought I was putting in as the auth code. The irb test I described above now works fine.