Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to obtain access token #23

Open
suederade opened this issue Jul 7, 2015 · 4 comments
Open

Failed to obtain access token #23

suederade opened this issue Jul 7, 2015 · 4 comments

Comments

@suederade
Copy link

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)

@Jemy09
Copy link

Jemy09 commented Mar 10, 2016

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

@tonyvibrant
Copy link

Change
$response = $client->getAccessToken(TOKEN_ENDPOINT, 'authorization_code', $params);
to
$response = $client->getAccessToken(TOKEN_ENDPOINT, 'AuthorizationCode', $params);

@hibernator11
Copy link

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. (node_modules/passport-oauth2-complete-for-wordpress/node_modules/passport-oauth/node_modules/oauth/lib/oauth2.js:143:7)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:944:16
at process._tickCallback (node.js:448:13)

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!

@hibernator11
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants