Topic-icon Call the JFB Connect via a link.

Active Subscriptions:

None
5 years 10 months ago #64142 by timchteure
Hi,
Is it possible to make the routine of JFB Connect work via calling an URL? (missing the words here to explain it properly).

Here is the use case. I have an app that is equivalent to a Progressive Web App (technology that I developped in house). The registration is done inside the app itself. There is also a Sign in with Facebook button.

I am aware that JFB is browser based, so I wanted to hook up the button on the app to load a URL (in the webapp) which then launches the registration via JFB. I am using currently the connect function from Community Builder but it started screwing up for unknown reasons on my site. So I would like to change to JFB Connect which works without any problems BUT I would need this URL (or function or anything which I can include in the button on the app) with which I can launch the login with.

Kind regards,
Tim
The topic has been locked.
Support Specialist
5 years 10 months ago #64151 by alzander
Tim,
Yup, it's very possible. All you need to do is redirect the user to the equivalent of:
index.php?option=com_jfbconnect&task=authenticate.login&provider=facebook&redirect=XXX&token=YYY
Redirect is the base64 encoding of the URL to return the user to after they successfully authenticate.
Token is the CSRF token that is generated for the user by Joomla

I'm assuming you know how to get those values already, but if not or you need more help, let us know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
5 years 10 months ago #64153 by timchteure
Hi,
Unfortunately I have to ask you for help again. I want the user to be redirected to "?bringbacktologindirectlyafterlogout34554". And... how do I get the CSRF token that is generated for the user by joomla?
I want to use the component only for registration as CB Connect dies on me all the time for no apparent reasons, while JFBConnect works perfectly...
The topic has been locked.
Support Specialist
5 years 10 months ago #64156 by alzander
For the redirect URL, put the address you want into the page below and you can get the Base64 version of it. There's plenty of tools in any language to do the same:
www.base64decode.com/

The Session token has to be generated by Joomla. So, the user will have to have a session opened in Joomla before the login attempt. To generate the token, use:
JSession::getFormToken()

I hope that helps get you going.

Finally though, if you're not already, please make sure you're using JFBConnect v8. Facebook has made numerous changes over the last few months and features of older versions of JFBConnect aren't fully compatible with the recent updates. For more information, see our blog posts:
* Facebook's Recent Changes Due to Privacy Breaches
* JFBConnect v8 Changes and Updates Required for Your Site

Thanks,
Alex
The topic has been locked.