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.
Options

JsConnect Issues

In the long run i'm trying to integrate usercake with a forum. I have ended up here with vanilla because the ease of use the integration can be.

All i ever get is:

{"error":"invalid_request","message":"The client_id parameter is missing."}

I have googled and searched this forum but no real solutions pop up just questions.

I have took the index.php from the libraries and replaced the client id and secret with ones generated from the admin of vanilla. All i ever get in the admin backend is: Validation does not exist: regex.

I have tried using the full information from usercake, id, username, email. Same result.

I have no idea what i am doing wrong, it seemed so straightforward.

Any help is appreciated.

Forum Version: 2.0.18.10 Jsconnect Version: 1.4.1

Comments

  • Options

    And I've closed that other discussion, linking to it, just in case there was more information there : http://vanillaforums.org/discussion/26034/jsconnect-issues

    There was an error rendering this rich post.

  • Options
    hgtonighthgtonight ∞ · New MVP

    Please try using the previous version, 1.0.3b, found here: http://vanillaforums.org/addon/jsconnect-plugin-1.0.3b

    1. Disable jsconnect in the dashboard
    2. Delete the jsconnect folder from your /plugins/ folder
    3. Upload the older version to your /plugins/ folder
    4. Enable jsconnect in the dashboard

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    @hgtonight said:
    Please try using the previous version, 1.0.3b, found here: http://vanillaforums.org/addon/jsconnect-plugin-1.0.3b

    1. Disable jsconnect in the dashboard
    2. Delete the jsconnect folder from your /plugins/ folder
    3. Upload the older version to your /plugins/ folder
    4. Enable jsconnect in the dashboard

    Same issue.

    Now i have my thinking cap on. It seems it is whenever i turned on Secure = true or set it to an encryption. Then it stops worked.

    This should be true unless you are testing.
    You can also use a hash name like md5, sha1 etc which must be the name as the connection settings in Vanilla.

    I have set it to secure = md5 and set md5 in the backend. Results in the same issue. As soon as i put secure = false. It works.

    Also, my forum is in a directory forum (domain.com/forum)

    So when i go to click SIGN IN WITH (SHORT NAME). the url is /entry/jsconnect?client_id=XXXX&Target=%2F

    resulting in 404 because it should be /forum/entry/jsconnect?client_id=XXXX&Target=%2F

    On line 107 of jsconnect.js

    var connectUrl = gdn.url('/entry/jsconnect?client_id='+client_id+'&Target='+target);

    changed to:

    var connectUrl = gdn.url('/forum/entry/jsconnect?client_id='+client_id+'&Target='+target);

    I did try putting it to var connectUrl = gdn.url('entry/jsconnect?client_id='+client_id+'&Target='+target);

    But that didnt work for some reason.

  • Options
    hgtonighthgtonight ∞ · New MVP

    gdn.url should map the garden url to a 'real' url.

    Be sure to set the following in your config:

    $Configuration['Garden']['WebRoot'] = '/forum/';
    

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    @hgtonight said:
    gdn.url should map the garden url to a 'real' url.

    Be sure to set the following in your config:

    $Configuration['Garden']['WebRoot'] = '/forum/';
    

    This didn't exist in the original config. So i added it, still same thing. looks at root /entry rather than /forum/entry

  • Options
    YonderYonder New
    edited February 2014

    So it seems i got this all working eventually. I guess when i set the secure to true. I still expected my

    jsonp string to read the values. Either way now secure is enabled it works fine.

    The only issue i have left is this /entry instead of /forum/entry.

    It also created a user: System system@domain.com

    Is this required or can i deleted?

  • Options

    if you view source look at the section bellow <!-- Various definitions for Javascript //-->

    you should inputs for WebRoot, UrlFormat, Path the would give you an idea what gdn.url() is using.

    grep is your friend.

  • Options
    YonderYonder New
    edited February 2014

    @x00 said:
    if you view source look at the section bellow <!-- Various definitions for Javascript //-->

    you should inputs for WebRoot, UrlFormat, Path the would give you an idea what gdn.url() is using.

    • <input type="hidden" id="WebRoot" value="example.com/forum" />
    • <input type="hidden" id="UrlFormat" value="/forum/{Path}" />
    • <input type="hidden" id="Path" value="" />

    Replaced domain with example. Looks good to me?

  • Options
    YonderYonder New
    edited February 2014

    Not sure what i am doing wrong. It seems to be one thing fixes and one thing breaks.

    So after a fresh install the jsconnect now directs to the correct /forum/entry (without doing anything but a reinstall).

    However now the jsconnect 1.4.1 does not use the logout url. Does Vanilla cache? Is there a way to clear it or turn it off for development mode?

    I've installed:

    • 2.0.18.10 - 1.4.1 jconnect regex issue
    • 2.1b - cannot enable plugins/themes had to comment out a line in settingscontroller (didn't like that)
    • 2.1b2 - works yet the logout url doesn't overwrite the logout log out for jsconnect and after successfully once getting it to work, i can no longer go back and edit it without getting regex issues.

    Created a route:

    entry/signout
    domain.com/logout.php
    Permanent (301)

    Then destroyed vanilla's cookie in my logout.php.

    Scared to touch anything now incase it breaks.

Sign In or Register to comment.