Skip to content

[BUG] WordPress authentication not working #10492

@cardoso

Description

@cardoso

Server to reproduce this bug: https://cardoso.rocket.chat
Version: 0.63.0

When pressing the OAuth button, I'm being redirected to this URL:
https://public-api.wordpress.com/oauth/authorize?client_id=57848&redirect_uri=https://cardoso.rocket.chat/_oauth/wordpress?close&response_type=code&state=eyJsb2dpblN0eWxlIjoicG9wdXAiLCJjcmVkZW50aWFsVG9rZW4iOiJPUXZPRm9yWDJSajNQXzNIQnpRTU1nTXM3VVlwRFY4ajUyQ2pBNkJDX1Q1IiwiaXNDb3Jkb3ZhIjpmYWxzZX0=&scope=openid

It should be this URL:
https://public-api.wordpress.com/oauth2/authorize?client_id=57848&redirect_uri=https://cardoso.rocket.chat/_oauth/wordpress?close&response_type=code&state=eyJsb2dpblN0eWxlIjoicG9wdXAiLCJjcmVkZW50aWFsVG9rZW4iOiJPUXZPRm9yWDJSajNQXzNIQnpRTU1nTXM3VVlwRFY4ajUyQ2pBNkJDX1Q1IiwiaXNDb3Jkb3ZhIjpmYWxzZX0=&scope=openid

Notice the oauth -> oauth2 change

When manually overriding this, I can go further into the OAuth flow, but the server throws these errors:

Server logs:

�[34mW20180418-12:40:39.984(0) (oauth.js:424) �[35mError in OAuth Server: Failed to complete OAuth handshake with wordpress at https://public-api.wordpress.com/oauth/token. failed [404] { "error": "not_found", "message": "The specified path was not found. Please visit https://developer.wordpress.com/docs/ for valid paths." }
�[34mI20180418-12:40:40.496(0) Exception while invoking method 'login' Error: Failed to complete OAuth handshake with wordpress at https://public-api.wordpress.com/oauth/token. failed [404] { "error": "not_found", "message": "The specified path was not found. Please visit https://developer.wordpress.com/docs/ for valid paths." }     at CustomOAuth.getAccessToken (/app/bundle/programs/server/packages/rocketchat_custom-oauth.js:150:21)     at Object.OAuth.registerService.query [as handleOauthRequest] (/app/bundle/programs/server/packages/rocketchat_custom-oauth.js:211:32)     at OAuth._requestHandlers.(anonymous function) (packages/oauth2.js:27:31)     at middleware (packages/oauth.js:194:5)     at /app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40 

The logs show this URL
https://public-api.wordpress.com/oauth/token

It should be accessing this URL:
https://public-api.wordpress.com/oauth2/token

Notice again the oauth -> oauth2 change.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions