passport-oauth
passport-oauth copied to clipboard
Failed to obtain access token
We are using WP Oauth Server and Passport-Oauth2-Complete-for-Wordpress and we are constantly running into this issue no matter what settings are chosen on WP Oauth Server. It is returned as code?=token, but never finds it.
InternalOAuthError: failed to obtain access token at /app/node_modules/passport-oauth2-complete-for-wordpress/node_modules/passport-oauth/lib/passport-oauth/strategies/oauth2.js:125:38 at /app/node_modules/passport-oauth2-complete-for-wordpress/node_modules/passport-oauth/node_modules/oauth/lib/oauth2.js:176:18 at passBackControl (/app/node_modules/passport-oauth2-complete-for-wordpress/node_modules/passport-oauth/node_modules/oauth/lib/oauth2.js:123:9) at IncomingMessage.
(/app/node_modules/passport-oauth2-complete-for-wordpress/node_modules/passport-oauth/node_modules/oauth/lib/oauth2.js:142:7) at IncomingMessage.emit (events.js:129:20) at _stream_readable.js:908:16 at process._tickCallback (node.js:355:11)
Hi,
we have a similar issue, trying to authenticate using the wordpress credentials, but always getting a error back:
failed to obtain access token (status: 400 data: {"error":"invalid_request","error_description":"Unknown request"})
This is the kind of query string that is returned:
?code=xhgcfxpf5cmphkc8uoequhvvqhjjg0ybmtbaky&state=_
Could you get yours to work? And what was for you the solution? Thanks for help regards
Change $response = $client->getAccessToken(TOKEN_ENDPOINT, 'authorization_code', $params); to $response = $client->getAccessToken(TOKEN_ENDPOINT, 'AuthorizationCode', $params);
Hi,
I'm getting the same error using WP Oauth Server and Passport-Oauth2-Complete-for-Wordpress
failed to obtain access token (status: 400 data: {"error":"invalid_request","error_description":"Unknown request"})
at node_modules/passport-oauth2-complete-for-wordpress/node_modules/passport-oauth/lib/passport-oauth/strategies/oauth2.js:125:38
at node_modules/passport-oauth2-complete-for-wordpress/node_modules/passport-oauth/node_modules/oauth/lib/oauth2.js:177:18
at passBackControl (node_modules/passport-oauth2-complete-for-wordpress/node_modules/passport-oauth/node_modules/oauth/lib/oauth2.js:123:9)
at IncomingMessage.
Where do I have to change the code in the Wordpress plugin or at the node passport-wordpress code?
Change $response = $client->getAccessToken(TOKEN_ENDPOINT, 'authorization_code', $params); to $response = $client->getAccessToken(TOKEN_ENDPOINT, 'AuthorizationCode', $params);
Thanks!
I finally made it!
Using this module https://github.com/ido-ran/passport-wordpress-oauth-server
I think that complete-wordpress plugin uses an old version of oauth and that is why is not working...
Thanks!