RocketChat / RocketChat/Rocket.Chat

Wordpress OAuth 3.1.96: Unable to Authenticate

Open
#2,815 44 comments 0 reactions 1 assignee View on GitHub

@rodrigok is already working on this.

Since Apr 8, 2016.

feat: oauth / sso type: bug
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Your Rocket.Chat version: 0.25.0

I'm having trouble authenticating using the Wordpress OAuth Server plugin, v3.1.96. I've been following the information in #747 but am still striking issues. I don't know if this is because the WP OAuth Server is now a later version that the one tested in the instructions.

On the WP side:

  • I've added $me_data['id'] = $me_data['ID']; to the filters.php file and uploaded a plugin zip with this change.
  • I also tried adding the code from the Gist to functions.php, but outcomes are the same.
  • I've checked all the Grant Types in the Advanced Configuration menu.
  • I've double and triple checked my Client ID and secret between WP and my RC instance.
  • I'm positive I've added the default RC redirect URL to the WP Client Details dialogue and saved it.

wpoauth

Scenario 1
  • In WP under Advanced Settings / Misc Settings I have "Require Exact Redirect URI" checked.

When attempting to login, the new window launched from RC and displays the following error:

{"error":"redirect_uri_mismatch","error_description":"The redirect URI provided is missing or does not match","error_uri":"http:\/\/tools.ietf.org\/html\/rfc6749#section-3.1.2"}

Nothing in the RC logs.

Scenario 2
  • In WP I have unchecked "Require Exact Redirect URI"

This time I am taken to the WP login form in the pop-up window, where I am able to login. However, after logging in, no re-direct occurs. I am simply shown my WP website content in this pop-up window.

RocketChat has not logged in, in the other window.

Scenario 3
  • As per Scenario 2, however I am still logged in to the WP website.

This time, when clicking the WP icon from the RC sign-in page, the pop-up window launches, then closes.

RocketChat shows an "Internal Server Error" message.

RC logs:

I20160408-15:13:43.047(0) at: cl7sculdskpuygnlmll8f9cklmmi0yyleiecfpol W20160408-15:13:43.897(0) (oauth_server.js:398) Error in OAuth Server: Failed to fetch identity from wordpress at http://mywebsiteurl.com/oauth/me. failed [400] {"error":"invalid_request","error_description":"Missing or invalid parameter(s)"} I20160408-15:13:44.077(0) Exception while invoking method 'login' Error: Failed to fetch identity from wordpress at http://mywebsiteurl.com/oauth/me. failed [400] {"error":"invalid_request","error_description":"Missing or invalid parameter(s)"} at CustomOAuth.getIdentity (packages/rocketchat_custom-oauth/custom_oauth_server.coffee:92:16) at Object.handleOauthRequest (packages/rocketchat_custom-oauth/custom_oauth_server.coffee:101:20) at OAuth._requestHandlers.(anonymous function) (packages/oauth2/oauth2_server.js:8:1) at middleware (packages/oauth/oauth_server.js:173:1) at packages/oauth/oauth_server.js:146:1

Scenario 4
  • When adding a new Client to the WP OAuth Server, there is a field to input the "Redirect URI:". The default text for this field says, "Leave Blank for Client Credentials." Therefore, in this scenario, I am leaving it blank.

The outcome is the same as Scenarios 2 and 3.

Scenario 5
  • The same setup as Scenario 4 with the blank client credentials, however, I am also re-checking the "Require Exact Redirect URI" checkbox under Advanced / Misc settings.

The outcome is the same as Scenarios 2 and 3.

Not sure what other information to provide. Have tested in the latest versions of both Firefox and Chromium.

Any assistance much appreciated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.