HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Vanilla 3.2 integration with Prestashop using jsconnect plugin.
testing3
New
Hello everyone,
Does anyone know how to integrate vanilla forum with Prestashop using the jsconnect plugin? I searched the forum and didn't find any post related to this topic, so I'm asking here.
Hope someone could help.
Any help would be greatly appreciated 😊
Thank you!
Kind Regards
0
Comments
Doesn't the documentation gives more insights? I never used jsConnect, therefore I really do not know it, but I think it looks quite exhaustive:
Yes, I've read that and followed the steps without any success (it was expected because I'm not a developer)
I'm not able to understand where should I put the files/codes in the Prestashop website.
I guess I'll have to hire a developer for this task.
Thank you so much for your help 😊
Kind Regards
yourVanillaforum/plugins/jsconnect/functions.jsconnect.php
to a prestashop/folder/functions.jsconnect.phpIn mysso.php you'd start by initiating Prestashop at the beginning. Something like the code below should grab the user.
#9 Replace the dummy code in mysso.php with actual Prestashop code for grabbing User ID, Email, Name etc
Thank you so much @donovanb for this detailed tutorial, I'll try it tonight and let you know if I could do it properly.
I forgot to mention that my Prestahop verion is 1.6, will it work with this version or it is for the latest version 1.7? Please let me know.
Thanks again, very much appreciated 😊
Kind Regards.
@testing3 I am almost certain the user object code is not a huge change from those versions, unless I am mistaken. This process I gave is a generic approach.
Oh, and I think you mentioned the wrong person, poor donovanb :)
Also, don't forget this: go to your vanilla plugin jsconnect settings page and grab client ID and Secret
If you are interested in using gravatar for your users, you may generate a link from their email address like so and fill up the
$user['photourl']
part:@donshakespeare, please accept my sincere apologies, I mistakenly clicked the name from the mention's drop down list 😀
I'll attempt to integrate according to your tutorial and let you know the result.
And I guess I'll have to put the Prestashop sign in, sign out and registration URLs in the jsconnect plugin settings-
And the "Authentication URL in the jsconnect setting should point to the mysso.php file.
And I'll have to create a new folder for the two required files in the root of the Prestahop website something like this- prestashop/include/mysso.php
prestashop/include/functions.jsconnect.php
Please let me know if this is correct.
Kind Regards.
Yes sir, you are correct on all counts.
Please check your prestashop (you said v1.6) folder tree
You want your new sso folder to be able to reach the official core config.inc.php file
https://devdocs.prestashop.com/1.7/basics/installation/configuration/#config-inc-php
So,
(core file)
prestashop/config/config.inc.php
(your files)
prestashop/include/mysso.php
prestashop/include/functions.jsconnect.php
For your existing prestashop users logged in already to your prestashop site, you can give them a special link to reach the forum if you want to carry over their credentials. community.example.com/forum/sso
And vanilla will log them into your vanilla automatically by virtue of the /sso appendix.
Thank you so much @donshakespeare sir!
I followed the steps and saved the files in the directory "/include/mysso.php" and "/include/functions.jsconnect.php"
When I login to my Prestashop website and after that try to access the https://forum.example.com/sso then I get this error-
Whoops!
Your sso timed out during the request. Please try again.
my forum is hosted on a sub domain "forum.example.com" and the Prestashop website is hosted on the main domain https://www.example.com.
Now where should I look for the error? Please let me know.
Kind Regards
2. Did you update your mysso.php with https://raw.githubusercontent.com/vanilla/jsConnectPHP/master/functions.jsconnect.php
3. When doing your testing from your main site to the forum, leave your browser's dev tool's console open to see what JS errors are being spit out.
4. AFTER trying all the above and if all fails, download this https://open.vanillaforums.com/addon/jsconnect-plugin-1.5.5
and replace your functions.jsconnect.php
There is a nasty header assumption within the latest jsconnect code that I suspect is the issue for you. So, when you try #4 let us know.
And this is the code in the mysso.php file-
Please let me know if I'm missing something.
Kind Regards.
include (dirname(dirname(__FILE__)). '/config/config.inc.php');
Test your example.com/mysso.php file directly in the browser from now on until you stop getting 500 error.
I would start with ...
You should get "HELLO"
Then this:
You should get a huge something ...
The config.inc.php exist and located in the httpdocs/conf/config.inc.php.
The other two files are located in httpdocs/include/functions.jsconnect.php and the mysso.php is also in the same folder.
I'm getting the "hello" and the huge data in the browser by running both provided codes.
I'm using NGINX revers proxy on the main website with php 7.1.
And vanilla forum is hosted on a sub domain and running on php 7.3 with the Apache server.
I tried to run the main Prestashop website with Apache and still getting the 500 error.
Should I provide the huge data here? Please let me know.
Thank you so much for your help, very much appreciated.
Kind Regards.
Excellent! It is not a pain at all troubleshooting with you and folks like you.
Yes, please provide the huge data,
redactingany important info of courseOk, so now it should look like this?
Please let me know if it is correct, because after editing it like this, I'm getting this error when browse the file in the browser-
{"error":"invalid_request","message":"Missing the v parameter."}
Yup! that is good! Now go to jsConnect plugin settings and "Test Url"
Never mind, the authantication URL was http, so I made it https and it's working now!!
@donshakespeare You're really a GREAT person and developer, thank you so much for your kindness and help 😊
Now just few more questions-
Thank you!
Kindest Regards
Glad you got that thing solved... hurrah!
1. As for Prestashop specifics I'd check here:
https://www.prestashop.com/forums/topic/622034-redirect-after-login-prestashop-17/
and here:
https://www.prestashop.com/forums/topic/396588-redirect-after-login-16/
2. No! JsConnect is a minimalist SSO one-way solution. What happens in Vanilla stays in Vanilla :) If you want my advice, DO NOT allow any other form of login into your forum when using SSO. Handle all that stuff from the mother site, in your case Prestashop. This allows you room to switch out forum software.
3. User lands in your mother site: they see all the available logins, by email, facebook, twitter etc .... see here
https://addons.prestashop.com/en/social-login-connect/39733-social-login-32-social-networks.html
https://www.knowband.com/prestashop-free-social-login
Thank you so much for sharing the GREAT info.
I'll just add the forum/sso button on the login page to visit the forum after signing up, and that should be enough 👍️
Thanks again from the bottom of my heart for your GREAT help 😊
Kind Regards.