Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

How to add user on the forum systems when register on custom website?

This discussion is related to the Vanilla jsConnect addon.

Hi,

I have a website which we have a Login & Register functionality separately.For SSO, I used Vanilla Jsconnect plugin, and it working nicely.
Now. I want to add the user to the forum system when they registered on my website. Currently, the forum system only adds a user when they access the forum system.

e.g
My website has two registered users.User X and User Y.
User X accessed the forums system and also registered on the forum system using SSO.
User Y never access the forums system, so not available on the forum system.

In Forum System, the problem with above flow is whenever User X wants to Personal "New Message" to another User Y who already registered on my website but not on the forum system won't be able to message because the forum system won't list User Y in the recipients' list.

Vanilla Version: 2.5.1

Vanilla jsConnect Settings:

Version: 1.5.4
Authentication URL: http://mysite.com/sso
Sign In URL: http://mysite.com/login?Target={target}
Registration URL: http://mysite.com/register
Sign Out URL: http://mysite.com/sso-logout
Make this connection your default signin method: Enabled
This is trusted connection and can sync roles & permissions.: Enabled
Signing In "Auto Connect" option is enabled.

User Registration Settings: Connect

Help me on this.Thank you in advance.

Comments

  • CaylusCaylus ✭✭
    edited February 23

    The problem is, there's no way for Vanilla to know user Y exists, because user Y never interacted with Vanilla.

    Even if Vanilla knows user Y exists, and user X sends them a message through Vanilla, user Y has no idea they now have a Vanilla account, so they're not likely to see the message anyway.

    If your registration system is build with Wordpress, you could write a Wordpress plugin that adds a "Ask this member to join the forum of this website" button on their Wordpress profile that sends them an email with a link to the forum, so they can join if they wish.

    Because in that case, Wordpress knows they exist, Vanilla doesn't.

  • @Caylus thank for reply.
    Does vanilla have any API to add user directly?
    If add user API is not exist, is there any manual way to do it?

  • x00x00 MVP
    edited February 23

    @jitesh_t

    It would not be a good idea to use the api becuase, it would not create the authentication data the connect method would

    A better idea woudl be to make use or redirect or a hidden frame. This means, hooking registration_redirect in wordpress

    grep is your friend.

  • or if not on wordpress set up you redirect so it direct to the vanilla entry page, with a Target pram back to you own site.

    What you want to do is turn on Auto connect, so they won't have manually do anything, it woudl just load, then ehy woudl be redirected back.

    So it is a sandwich or redirects with jsConnect auto connect in the middle.

    grep is your friend.

  • you would need $Configuration['Garden']['Registration']['AutoConnect'] = true;

    grep is your friend.

  • x00x00 MVP
    edited February 23

    hidden frame method, you would only have to load page with a firame pointing to vanilla entry page, with auto connect.

    Either thsi could be a transition page, in which case you would need to check that it has been loaded before moving on our you could load on every page until the connection has been established.

    You can also use the basic API to check if a vanilla session exists so this could be done mostly by javascript, and could repeat it until you have one.

    grep is your friend.

  • x00x00 MVP
    edited February 23

    the basic (read only) api would be only to check if the session exists and if not you create the iframe. e.g.

    https://open.vanillaforums.com/profile.json is different when there is a browser session, you would check this in through ajax json. JSONP works with the api but the cookie authentication won't work great cross domain, so the redirect method would be more full proof in that case.

    you could point to entry/signin or any html page that responds to auto connect in the hidden frame.

    grep is your friend.

  • You will probably also what to save the status on your custom site once you have created a session and make it conditional on this otherwise the would repeat needlessly.

    grep is your friend.

Sign In or Register to comment.