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.
Installing jsConnet
![rvch](https://secure.gravatar.com/avatar/52eaf88e0f269842849f63ffde165f3c/?default=https%3A%2F%2Fvanillicon.com%2F1a407720ef2c4e2329d7e1b56d519b41_100.png&rating=g&size=100)
My web site has its own "login" in wsite/index.php and
vanilla forum in wsite/vanilla/ the auth.json file in wsite/vanilla
I generete client ID & secret with vanilla Dashboard
Site Name: www.site.es
Authenticate Url: /vanilla/auth.json
Sign In Url: /index.php
Register Url: /registrar.php
The code WriteJsConnect($user...... is in the wsite/index.php
I test URL and obtain "page not found error 404"
Can I get some help
Thanks
0
Answers
likely, one or more of your urls is incorrect
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
Hola hbf I sent a email to you but I haven't permission to comment through email.
Thanks for your quickly answer.
I test different urls and impossible to avoid the 404 error.
Well, let ask some questions to tray understand concepts and fix my Knowledge. I am new in php and have a lot of limitations specially with http functions.
With the user ID, name, email, etc. validated in web login, Jsconnect send data to auth.php page with the function WriteJsConnect($user, $_GET,.... .
Auth.php page is a blank page without code.
I include the functions.jsconnect.php in the login.php and in registrar.php.
I put the example you provide in login.php and registrar.php, we only need to adapt code to build correctly the array $user with client ID, secret, etc.
Vanilla get data of auth.php page and login user in the forum.
Finally putting the correct URL with vanilla dashboard. And should it works.
It´s that correct?.
Thanks for your help
i've never actually setup jsconnect, so i'm only able to provide some clues as to where i would start debugging.
the first thing to do is to determine what url it's trying to load when you get the 404. basically a 404 just says, you asked for something on this server, and i have no resource (file) at that path.
once you know what its trying to load and cant find, then figure out why it cant find it.
you'll have to play detective here, look for the clues. post info that you dont know how to interpret and someone should be able to decipher it for you.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
Please privide full urls to the authentication link.
I would not put the authentication script in the same folder as your vanilla install
Do you use a jsconnect library for php?
Helo HalfCat,
I am using local host and two virtual host; one for www.site.es and a different one for www.vanilla.es
I change auth.json to www.site.es/
With full paths now a blank page appears when testing. The log in site is Ok but not in Vanilla,
The functions.jsconnect.php is in www.site.es/. I get from "Implementing Vanilla jsConnect Single-Signon on your Site". Is include before preparing $user array.
I only use $user['email'] and $user['name'] vars to pass vanilla login. Is sufficient?
Thanks
I don't understand. You have to include the functions.jsconnect.php into the script you use to produce the json data.
No, it is not. You need to set $user['uniqueid'] too. This is how it looks like for me after some error checking:
I don't know how your own login process is created but you should be able to work this out...
Thanks HalfCat,
Now I get the error
{"error":"invalid_request","message":"The client_id parameter is missing."}
Ok, we are making progress. Can you post the part of the code you are passing in the WriteJsConnect function?
You mind this:
require_once 'functions.jsconnect.php';
$clientID = "68065092";
$secret = "a5e0ce3589ec6fd8cbb39396b33ac4fd";
$user = array();
$user['uniqueid']=$_SESSION['userid'];
$user['email'] = $_SESSION['email'];
$user['name'] = $_SESSION['alias'];
$user['photourl'] = '';
$secure = true;
WriteJsConnect($user, $_GET, $clientID, $secret, $secure);
Mhm, that seems to be correct. Do you have
session_start();
at the beginning of your script?Yes
Can you print the Session array correctly?
Yes
And you get this error when you call the Test-URL in your dashboard, right? If that is the case, I am at the end of my knowledge. I don't know what else could be done here, sorry...
I get the error in de index.php when finishing the process of login on my web site and after call to WriteJsConnect.
With test I get a blank page with this url
http://www.website.es/auth.json?client_id=68065092×tamp=1356708557&signature=aa8eed9bd48989fd180896f674751d01&Target=%2Fdashboard%2Fsettings%2Fjsconnect&callback=test
Something is severely wrong. You do not call WriteJsConnect in your login process. You only call that on a page that has only one purpose: be the authentication url for vanilla. This site is only called by the javascript of vanilla, it isn't there to be called by you in your login process. What does that
auth.json
file look like?The auth.json file is blank. What we need to put there?.
Err, all the code we discussed above. Just don't name it
auth.json
but ratherauth.json.php
as you want executable php in there. Alternatively just change the settings of your jsConnect in your dashboard to point to the file where you have the code already...