× Joomla Facebook Connect support forum

Topic-icon Auto login JS snippet

Active Subscriptions:

None
15 years 5 months ago #6282 by ramez
Auto login JS snippet was created by ramez
Hello again,

I am running a FB promotion where users get free access to content. From our FB fan page, they are directed to a custom page within the site. In this page, I would like to the FB login process to be triggered automatically (as if they clicked on the 'login with facebook' button) as part of our conversion funnel.

I tried to use the .click function (jQuery) on document load, but it failed. I think it may be because the 'login with facebook' button is within an iframe, so the container doc sees the page as fully loaded even if the iframe is not fully loaded yet (separate doc).

Any suggestions would be greatly appreciated.

Thanks
The topic has been locked.
Support Specialist
15 years 5 months ago #6286 by alzander
Replied by alzander on topic Auto login JS snippet
I'm afraid it's not possible to do what you're asking. The request comes up every few months, and we've never found a way to do this. Mainly, Facebook doesn't want you to do it because they don't want to give the ability to force your users to connect to your application/site. While you're motives may be benign, and even positive by using a reward for doing so, Facebook makes it so that the user has to take each action on their own (click the login button and then intentionally granting permissions).

They do a similar prevention mechanism with their invitation logic (in our JFBCInvite module) to prevent admins from even tracking how many users someone has invited... so that you can't give incentives for having users invite all their friends.

Again, it's possible there's a way around this, so if you manage to come up with something, let us know. Controlling an iFrame through Javascript is going to be impossible though because that's cross-site scripting, and almost all browsers will prevent that from working.
The topic has been locked.