The request method must be POST when requesting an access token
-
Grettings from Bangkok!
Almost all the way through the OAuth process and now getting this error. this is the “?oauth=token” endoint. The METHOD is definitely set to POST. Setting the POST Method works properly for the “?oauth=authorize” leg of the process.
Here is the entire error which appears in the browser:
{“error”:”invalid_request”,”error_description”:”The request method must be POST when requesting an access token”,”error_uri”:”http:\/\/tools.ietf.org\/html\/rfc6749#section-3.2″}My setup:
Plugin Build: 3.1.96
PHP Version (5.5.31): OK
Apache Version: Apache/2.4.18 (Unix) LibreSSL/2.2.6 PHP/5.5.31 This is the frontend, SSL-enabled Apache server. The OAuth code is running on a backend mod_perl enabled server.
Running CGI: OK
Certificates Generated: Certificates Found
License: Standard
In this Apple development environment custom permalinks are not set (no .htaccess file).Here is the URI I return back to the server: [pardon, the line breaks are a bit messed up]
https://planetman?oauth=token&client_id=<example>&redirect_uri=https://planetman/autoquote/&client_secret=<example>&code=<valid code>&grant_type=authorization_codeMy question is this: might the error message be imprecise? In other words, could another error condition be triggering this particular error message?
From this support request: How get the token ?, I infer that I might need to stuff something into the HTTP headers, like BASE64-encoded parameters. Is that right? If so, what are the values to encode?
This is my very first try setting up OAuth, and this step is as far as I’ve gotten. In other words this application has never worked, so nothing has recently broken.
I should also ask, once this step is successful, will the server send a query arg with the “access token”? Is “access token” the name of that query arg?
many thanks!
The topic ‘The request method must be POST when requesting an access token’ is closed to new replies.