Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
[Solved] JSConnect and Wordpress integration
I appear to have a problem, my site evulgaming.com is wordpress and running simple:press, however I am really not happy with it and think Vanilla is great.
I have JSConnect installed here and have the integration embed done fine. However I really seem to run into an issue with the SSO system, it wont allow me to login with my WP account, if I click login on the forum, it takes me to the WP login page I setup, I type my credentials in and then I am redirected back to the forum, not signed in.
Any help in the matter is much appreciated, if more info is required I would be happy to ablige.
Thanks in advance,
Sp4wn
Tagged:
0
Answers
A few things you can do to troubleshoot.
Click the "test url" link in Vanilla's jsConnect config page. Try it both when you are and aren't signed in to your Wordpress site.
Browse to /role/defaultroles in your site and make sure you have default roles set up. If users don't have a default role then when they won't have any permissions within Vanilla and won't appear to be signed in.
Cheers Todd.
Logged out or in, the test URL sends me to the wordpress homepage. It uses the VFRequest URL to get there however.
Are we talking default roles on the Vanilla side or Wordpress? I have default set to in wordpress and have email confirmation default role set to member in Vanilla, I have also selected "connect" in registration, new members are only registered via SSO plugin.
I forgot to mention that I am also running buddypress and that the pre-defined page setup from the wordpress plugin that you paste into the JSConnect might not be entirely correct for Buddypress.
I might look into changing the pages from the plugin manually as there is no way to edit them from wordpress.
Any other info would be much appreciated, I really want to go with VF, but SSO is a must.
Thanks again,
Sp4wn
Embarrisingly it appears I have been using the wrong plugin on the Wordpress side, I have now installed the correct one and everything appears to be working correctly.
Thanks for the troubleshooting Todd, you gave me the idea. Apologies for the inconvenience.
Sp4wn
It appears I may have been to hasty with thinking I had this. The admin aacount will authenticate and let me sign in, however it is a matching account from wordpress and vanilla.
It will not however let my members sign in or my test standard account, it just redirects me to the page not logged in. It is recognising that the user is logged into WP as when it asks you to sign in via the site, it has the username ready.
I am completely stuck with this and really need help.
Thanks in advance,
Sp4wn
Edit: I have also noticed in chrome the popup opens and automatically closes when trying to sign in the SSO.
WordPress database error: [Table 'redacted.wp_signups' doesn't exist]
Select user_email from wp_signups where active=0 and registered < '2012-03-28 15:43:47'
God I feel like I am spamming this thing.
I cant believe how simple it was.
vanillaforums.org/discussion/19481
For future peoples reference.
Marking this as solved.
Much love,
Sp4wn
@Sp4wn: I could really need your help. Where and how the permissions? I don't get it work for weeks. Please help!
I have the exact same problem, but I've already looked in Vanilla for default roles. They appear to be set correctly. This is a stock install from Dreamhost. I have PHP logging enabled in my PHP5.3 RC file and have enabled Debug mode for WordPress and Vanilla ... no errors to note. Nothing to go on. Here's my behavior:
http://www.mydomain.com/wp-login.php?redirect_to=http%3A%2F%2Fforum.mydomain.com%2Fentry%2Fjsconnect%3Fclient_id%3DXXXXXX%26Target%3D%252F
http://forum.nfphc.org/entry/jsconnect?client_id=XXXXXX&Target=%2F
OR ...
www.mydomain.com/?page_id=6
) ... click on "Log in with XXXX"http://forum.mydomain.com/index.php?p=
After either process, my user has a cookied session within WordPress, and going back to the main site will show that the user is indeed logged in. The credentials just never make it to Vanilla ....
Any help?
I have a similar issue. Signing in through wordpress signs me in to the forum, but from the forum the "Log in with ..." option does not seem to work at all.
A separate issue I have is being able to link an existing account(prior to SSO being active), but I can ignore that.
OK ... @Lincoln thanks for helping me out with this. My issue seems to have been resolved by upgrading to the 2.1 Garden beta with 1.4.1 jsconnect. I was previously on a stock-dropped 2.0.18 Garden and 1.0.3b jsconnect from DreamHost. So if you find yourself behind the times with your versioning, take heart and upgrade!
@nilsonj Glad it's working!
For the technical version: Using Vanilla 2.0.18 & jsConnect 1.0.3b there's two ?s in the jsConnect query string to WordPress which causes the client_id etc to get dropped. This is likely a bug in the URL builders somewhere. If you're having jsConnect problems, as he said, go to 2.1 (beta, presently) & 1.4.1.
@Lincoln @nilsonj
I can't use jsConnect 1.4.1. I installed Vanilla 2.1 beta 3 and jsConnect 1.4.1. and if I try to add a connection it says: "Validation does not exist: regex.". It's the exact same error like in the version before. Help, please?
@holybrowncow In /library/core/class.validation.php on line 468
Change this:
To this:
Thanks for the answer. Unfortunately it says: "Validation does not exist: ‘validateregex’." now. Any idea?
Now it says:
OR Validation does not exist: ‘validateregex’ when i try to save. Sometimes on sometimes the other one appears.
Does the error message really have single quotes are validateregex like that? "Validation does not exist: ‘validateregex’." That would indicate maybe you didn't change the line exactly as I described and perhaps got some extra quotes in there.
Did you run /utility/update after moving to 2.1b3?
I would also try re-copying the files and confirming that /library/core/functions.validation.php exists and is current.
I ran /utility/update after moving to 2.1b3. I also re-copied the files and changed the file again. I attach a photo so you can see if I did anything wrong.
Add this to your config.php:
$Configuration['Debug'] = TRUE;
That will reveal the actual error instead of "Something has gone wrong"
That's the whole error message:
Fatal Error in Gdn_Database.Query();
Unknown column 'IsDefault' in 'field list'
insert ignore GDN_UserAuthenticationProvider
(
Name
,AuthenticationKey
,URL
,AssociationSecret
,AuthenticateUrl
,SignInUrl
,RegisterUrl
,SignOutUrl
,IsDefault
,AuthenticationSchemeAlias
,AssociationHashMethod
,Attributes
)values (:Name, :AuthenticationKey, :URL, :AssociationSecret, :AuthenticateUrl, :SignInUrl, :RegisterUrl, :SignOutUrl, :IsDefault, :AuthenticationSchemeAlias, :AssociationHashMethod, :Attributes)
The error occurred on or near: /www/htdocs/w010aa40/therandomslap/forum/library/database/class.database.php
290:
291: if (!is_object($PDOStatement)) {
292: trigger_error(ErrorMessage('PDO Statement failed to prepare', $this->ClassName, 'Query', $this->GetPDOErrorMessage($this->Connection()->errorInfo())), E_USER_ERROR);
293: } else if ($PDOStatement->execute($InputParameters) === FALSE) {
294: trigger_error(ErrorMessage($this->GetPDOErrorMessage($PDOStatement->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR);
295: }
296: } else {
297: $PDOStatement = $this->Connection()->query($Sql);
298: }
Backtrace:
/www/htdocs/w010aa40/therandomslap/forum/library/database/class.database.phpPHP::Gdn_ErrorHandler();
[/www/htdocs/w010aa40/therandomslap/forum/library/database/class.database.php:294] PHP::trigger_error();
[/www/htdocs/w010aa40/therandomslap/forum/library/database/class.sqldriver.php:1650] Gdn_Database->Query();
[/www/htdocs/w010aa40/therandomslap/forum/library/database/class.sqldriver.php:1114] Gdn_SQLDriver->Query();
[/www/htdocs/w010aa40/therandomslap/forum/plugins/jsconnect/class.jsconnect.plugin.php:491] Gdn_SQLDriver->Insert();
[/www/htdocs/w010aa40/therandomslap/forum/plugins/jsconnect/class.jsconnect.plugin.php:443] JsConnectPlugin->Settings_AddEdit();
[/www/htdocs/w010aa40/therandomslap/forum/plugins/jsconnect/class.jsconnect.plugin.php:443] JsConnectPlugin->SettingsController_JsConnect_Create();
[/www/htdocs/w010aa40/therandomslap/forum/library/core/class.dispatcher.php:337] PHP::call_user_func_array();
[/www/htdocs/w010aa40/therandomslap/forum/index.php:46] Gdn_Dispatcher->Dispatch();
Variables in local scope:
[Sql] 'insert ignore GDN_UserAuthenticationProvider
(
Name
,AuthenticationKey
,URL
,AssociationSecret
,AuthenticateUrl
,SignInUrl
,RegisterUrl
,SignOutUrl
,IsDefault
,AuthenticationSchemeAlias
,AssociationHashMethod
,Attributes
)values (:Name, :AuthenticationKey, :URL, :AssociationSecret, :AuthenticateUrl, :SignInUrl, :RegisterUrl, :SignOutUrl, :IsDefault, :AuthenticationSchemeAlias, :AssociationHashMethod, :Attributes)'
[InputParameters] array (
':Name' => 'Subscriber',
':AuthenticationKey' => '388668754',
':URL' => NULL,
':AssociationSecret' => '139ac66ee130b8355d843497be7fbaf0',
':AuthenticateUrl' => 'http://www.therandomslap.com/?VFRequest=connect',
':SignInUrl' => '',
':RegisterUrl' => '',
':SignOutUrl' => '',
':IsDefault' => false,
':AuthenticationSchemeAlias' => 'jsconnect',
':AssociationHashMethod' => 'md5',
':Attributes' => 'a:3:{s:8:"HashType";s:3:"md5";s:8:"TestMode";b:0;s:7:"Trusted";b:0;}',
)
[Options] array (
'ReturnType' => 'ID',
)
[ReturnType] 'ID'
[PDOStatement] array (
'queryString' => 'insert ignore GDN_UserAuthenticationProvider
(
Name
,AuthenticationKey
,URL
,AssociationSecret
,AuthenticateUrl
,SignInUrl
,RegisterUrl
,SignOutUrl
,IsDefault
,AuthenticationSchemeAlias
,AssociationHashMethod
,Attributes
)values (:Name, :AuthenticationKey, :URL, :AssociationSecret, :AuthenticateUrl, :SignInUrl, :RegisterUrl, :SignOutUrl, :IsDefault, :AuthenticationSchemeAlias, :AssociationHashMethod, :Attributes)',
)
Need Help?
If you are a user of this website, you can report this message to a website administrator.
If you are an administrator of this website, you can get help at the Vanilla Community Forums.
Additional information for support personnel:
Application: Vanilla
Application Version: 2.1b3
PHP Version: 5.4.26-nmm1
Operating System: Linux
Server Software: Apache
Referer: http://www.therandomslap.com/forum/settings/jsconnect/addedit
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9
Request Uri: /forum/settings/jsconnect/addedit
Controller: Gdn_Database
Method: Query
Apart from that it also shows me this on every page:
Info Need to re-index theme cache
Info Need to re-index plugin cache
Warning Master views differ. Controller: /www/htdocs/w010aa40/therandomslap/forum/applications/dashboard/views/default.master.php, ViewLocation(): /www/htdocs/w010aa40/therandomslap/forum/applications/dashboard/views/default.master.tpl <
So, there's no solution? I guess that means I have to go for bbPress.