-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
Wordpress OAuth 3.1.96: Unable to Authenticate #2815
Comments
I installed the older 3.1.7 version and still receive the error:
The URL in the pop-up login window includes the following: redirect_uri=http://myrcinstance.com/_oauth/wordpress This is exactly the same URL I have entered in the "Redirect URI:" field in the WP OAuth Client details screen. |
I have followed the instructions in #747 and created a custom RC OAuth entry, just calling it "wordpresscustom". I updated the details in my WP OAuth Client details with the new redirect URI. This has overcome the "redirect_uri_mismatch" error. The pop-up window presented me with the WP login screen. This is with "Require Exact Redirect URI" checked in the WP OAuth Server settings. Unfortunately, after logging in, the pop-up did not disappear, rather it just showed me a page of my WP website content. After closing the pop-up, and clicking the "WP Custom Login" button on my RC login page (this time already logged into WP), I once again see the Internal Server error in the RC logs:
Pretty much the same as Scenario 3 above. I have successfully setup a GitHub OAuth on my RC instance, just to check that worked. However, I would really like WP to work, as my subscribers already have accounts on my WP site. |
Just to be on the safe side here, you guys tried using the built-in Wordpress OAuth, right? meanwhile, I'll try to run a few tests with our demo. |
So this actually is working now. It is not exactly what I desired but I think it's what you are after @wargamesqcf The main thing causing a problem was that I used a self-signed SSL certificate. I got this because I just wanted to test things out. I got a real SSL and it worked. I also maybe did an adjustment on my checkboxes, so let me post what I've got. The trouble I still had... i actually want the reverse. I was hoping that all my meteor users would be able to login to WordPress with their meteor accounts. This lets them login to Meteor using WordPress. Here are the settings on WordPress. This is for OAuth Server 3.2. I am not sure if I had 'enforce state parameter' checked before when I was receiving errors. But it is checked off now and it works. I also have 'require exact url' UNchecked. On my RocketChat, I did not use the WordPress OAuth, I created a custom one. URL: https://peerunschooling.net My app is at https://members.peerunschooling.net and I was able to successful embed the app as an iframe here: https://peerunschooling.net/chat-app I just gotta find a way to do the reverse. Or maybe this auth0.com thing is the answer. I would like to keep it simple, this has become more time consuming that I expected. |
Just doesn't work on the non-pro verison. |
I've been having this issue, and I've got it working with the settings listed from @flantascience above on non-pro WP Oauth server 3.2.001. The strange thing is: it works fine with the desktop Rocket.chat app, but the iOS app gives me:
|
Anyone actually using the WordPress OAuth section of the settings (not a custom oauth one) and is able to authenticate with the latest version of WP Oauth server? |
@wargamesqcf we are thinking of switching to Method 2 endpoint format as documented here to improve compatibility - https://wp-oauth.com/kb/endpoint-formats/ Especially with the non-pro version of the popular plugin. Have you had any experience with it? Thanks. |
Tried method 1 and method 2 got this as an error, also using verison 3.2002 of WP Oauth server, and 54.2 of rocketchat My settings |
@wargamesqcf What did you have to do to the permalink setting to get Method 1 working with the non-pro version ? Also did you have to tinker with your .htaccess file? |
@wargamesqcf This PR, thanks to @sampaiodiego , should allow method 2 to work with your settings. #6684 Please test. Thanks. |
I never got it working on verison 3.2+ of WP oauth non-proversion only ever got it working on the older 3.1.96. |
@wargamesqcf Good to know. Thanks. Please try the PR with your custom oauth settings - using method 2 format - it should now work with any version of the plugin. |
What do you mean by PR? |
@wargamesqcf PR = Pull Request = code fix when merged Please click this to see the details and track the branch that it lands on: |
Tried method 1 and method 2 got this as an error, also using verison 3.2002 of WP Oauth server, and 55.1 of rocketchat My settings From my logs I get this error �[34mW20170421-02:18:26.645(0) (oauth.js:431) �[35mError in OAuth Server: Failed to fetch identity from wordpress at http://www.five-rings-online.net?oauth=me. Unexpected token < |
Here is what works for me after experimentation in RC's #wordpress channel. Thanks @Sing-Li Tested in browser only with Ubuntu 16.04, WordPress 4.7.4, Rocket.Chat 0.55.1 (docker) and the free wpoauth plugin at version 3.2.002 In RC add Custom OAuth, don't use the WordPress one. For the name use something else than wordpress like your site name. (otherwise it might bug) Enable: True I also use Login style: Redirect In Wordpress install WP OAuth Server plugin ver 3.2.002. Go to OAuth Server > Clients > Add new client and for the Redirect URI copy Callback URL from the top of your Custom OAuth page in RC for example. http://yourwordpress.com:3000/_oauth/myoauth (i have ssl: https://chat.mysite.com/_oauth/myoauth) Copy Id & Secret (hover mouse over client to see secret) and put them into your RC Custom OAuth settings. After saving changes for the client you might have to update permalink structure in WP > settings > permalink > 'Save Changes' Create new WP user with simple password and email that isn't used by any RC users. Finally clear all cookies/history and go to your RC login page and the new button should redirect you with WP. Extra: putting user_login in custom oauth "Username field" automatically forces WP username when authenticating for the first time. Might require "Merge users" to be set to false. |
Thank YOU! @Bluer-RC ! (and @wargamesqcf !) for all your extensive help in testing this! @phillc73 @lovetheidea @johnlund @flantascience and others .... We know WordPress is the current leader for websites creation. Ongoing, we're committed to make sure that the current FREE edition of the wpoauth plugin work with Rocket.Chat. As of Rocket.Chat 0.55.1 - and wpoauth FREE 3.2.002, things should be working as detailed by @Bluer-RC . We will follow up with formal documentation soon (we are short of doc staff, and can use any documentation contribution here : https://github.com/RocketChat/Rocket.Chat.Docs ). As the Rocket.Chat version and wpoauth server versions evolve independently, if you should find any breaking changes - please report them asap on new tickets. Thanks in advance for your help. |
Is there a known method to make WP use RC as an oauth provider? - ie log into WP usig a RC/meteor account? |
I can confirm that using the name "Wordpress" as a custom oauth in RC fails and probably because it conflicts with the built in Wordpress.com oauth. Notice the call back url is the same https://rcdomain.chat/_oauth/wordpress so of course, it would conflict. I reneamed my custom oauth to "wordpressoauth" and it worked fine. I can also tell it is conflicting because my custom oauth, when named Wordpress, is showing the Wordpress logo on the button even though its custom and it knows not that it is for Wordpress....the built-in Wordpress button is being used. Now I only have one more issue. I CAN NOT delete the custom oauth I created named Wordpress. I click remove and nothing happens. I imagine this is probably because of the conflict too since the built-in one is not allowed to be deleted and this has the same name. I guess moving forward creating a custom OAuth named "Wordpress" or "wordpress" should be blocked by RC but as far as people who already did we need a way to delete it. Also correct me if I am wrong but isnt the built in one for wordpress.com not wordpress.org (hosted not self hosted). |
I'm having an issue with this.... I've got the OAuth working as a "Custom"
OAuth. PROBLEM: when logging in via the Rocket.Chat mobile application,
the WebView for logging in doesn't close. So someone logging in for the
first time, clicks on "Login with WordPress', the WebView pops up asking
for their WordPress login info, and then they get logged intot he WordPress
site in the WebView but never go back to the app. The have to manually
close the WebView. I know this may not seem like a big deal, but its a
particular problem for NEW users.... because they don't fully realize
they're entering the website instead of the Rocket.Chat app. Any ideas?
Jim Flannery
jim-flannery.com
p. 860-578-4966
e. jim@jim-flannery.com
s. jim_flannery
…On Mon, May 14, 2018 at 1:36 AM, Henry Weismann ***@***.***> wrote:
I can confirm that using the name "Wordpress" as a custom oauth in RC
failes and probably because it conflicts with the built in Wordpress.com
oauth. Notice the call back url us the same https://rcdomain.chat/_oauth/
wordpress so of course, it would conflict. I reneamed my custom oauth to
"wordpressoauth" and it worked fine. Now I only have one more issue. I CAN
NOT delete the custom oauth I created named Wordpress. I click remove and
nothing happens. I imagine this is probably because of the conflict too
since the built-in one is not allowed to be deleted and this has the same
name. I guess moving forward creating a custom OAuth named "Wordpress" or
"wordpress" should be blocked by RC but as far as people who already did we
need a way to delete it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2815 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AL_pYoEu0Btbpl3AIxZmP3waZhQ40nfFks5tyRf1gaJpZM4IDG4E>
.
|
I'm revisiting this because now that I'm trying to get the mobile app working, this error has returned: Desktop works fine. But this error prevents the mobile app from connecting. |
@flantascience ios or android? |
@geekgonecrazy This is on IOS |
@rocketchat/ios thoughts? |
@flantascience On the OAuth settings section for Wordpress, what's the value you're using for Server Type? Have you tried changing it? |
@rafaelks where do you see "Server Type"? I've tried this using both WP OAuth Server and WP OAuth Server Pro. Neither has a setting for "Server Type" that I see. Inside of Rocket.Chat, I don't see a setting for "Server Type" either. |
Just to keep this thread updated:
|
Following the above link for instructions, and with the paid version I am seeing this issue still. do we know if this is an issue with WP-Oauth or RocketChat? I am using a custom OAuth and using the settings in https://wp-oauth.com/docs/how-to/rocket-chat-oauth-setup/ and continue to get errors. |
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:
$me_data['id'] = $me_data['ID'];
to the filters.php file and uploaded a plugin zip with this change.Scenario 1
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
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
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
The outcome is the same as Scenarios 2 and 3.
Scenario 5
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.
The text was updated successfully, but these errors were encountered: