Facebook Registration Plugin

Permalink 1 user found helpful
Ahh, such a tired subject, from my viewpoint at least. I used and abused the forum and site search for any type of insight on using Facebook to authenticate users. I can absolutely not believe there isn't more on this... All I found were a couple of simple, non-customizable add-ons costing $15 up.
To be clear, I'm using the Registration Social Plugin:https://developers.facebook.com/docs/plugins/registration/...
not Login, or OAuth. I have already modified my login/registration pages and single pages, but now I'm going to replace the native registration with the Fb code:
<iframe src="https://www.facebook.com/plugins/registration?
      {'name':'occupation','description':'General Occupation','type':'select','options':{'Artist':'Artist','Dancer':'Dancer','Manager':'Manager','Musician':'Musician','Photographer':'Photographer','Venue':'Venue'}},
      {'name':'akID[9][value]','description':'Receive private messages','type':'checkbox','default':'checked'},
      {'name':'akID[10][value]','description':'Send me email notifications when I receive a private message','type':'checkbox','default':'checked'},

Hitting the button passes the data through Facebook back to login/do_login/ as a JSON Object (Format found under "Reading the data" in the link above). They then give an example of how to read the data using PHP (Found under "PHP Example reading signed_request" on the same link). This is where I'm stuck. I have no idea where to place this or how to assign the data. I'm thinking it goes in the Login controller and that the $data var in the example is an array or something that I need to split up into the different variables of the system. (Edit, I'm reading the json_decode manual on php.net where it says json is decoded into php variables. Still doesn't make sense.)
Oh, and because I'm adding custom attributes with the facebook registration like Occupation, I assume I have to add those in in the control panel before it'll work right. That's another thing I'm not sure how it works, as in assigning the data to the custom attributes. Oh my. Thanks for your help

View Replies:
hiphopeagleeye replied on at Permalink Reply
hiphopeagleeye replied on at Permalink Reply
jordanlev replied on at Permalink Reply
I haven't the first clue about how facebook login integration works. But it sounds like you're using a method that doesn't actually require integration, but rather takes facebook account data and automatically creates a C5 account for that data? (Or does it just log them in after an account has already been created? Or does it need to figure that out one way or the other??).

I've made registration/login forms in lightboxes before, which use ajax to login/register. See sample code here:

Perhaps you can merge that into what you're trying to do with the facebook thing?

Good luck!

Steevb replied on at Permalink Reply
Have you put the 'fb code' in your header?

You need that before any page inserts.
hiphopeagleeye replied on at Permalink Reply
@jordan The Facebook form is basically the same thing as a regular form, but it's filled in automatically from your profile info. It passes the data through Facebook to authenticate and then passes it back to my own controller which should then make a new account and apply the data to that account. I'm actually using ajax right now to display the form, but I'll take a look at your example.

@55webdesign I'm not sure what you mean by 'fb code' but the Facebook side is finished, it's the concrete side that I need help with
Steevb replied on at Permalink Reply
Sorry, different type of FB integration±!

This might help:

hiphopeagleeye replied on at Permalink Reply
This page is really detailed and helpful, but mainly if you're using your own db system. There's nothing about how the c5 register system works and how to pass it info, but I'll take another look at it to see how exactly the json is decoded. I'm not sure if I need the Facebook php sdk or not, I don't think so
hanicker replied on at Permalink Reply
Hi. I can't understand why you don't want to use one of the packages that allow facebook connect.
Some of them are really easy to customize, by modifying the view.php of the block that displays user info or login button.

Anyway, you have to handle the connection between facebook login and c5 users.

You will need facebook sdk to communicate with fb, expecially to forge requests.

Facebook connect package basically follows these instructions:

Anyway, you will have to handle different things, like:
create an attribute for the user to store facebook id and other data
assign every user a username and a password and, if possible, email the user these data
create a block that handles facebook login.

I'm pretty sure you will be able to write a working package by following that suggestions. Btw, I would suggest you to check for Social Login package, used by many sites, that costed me 3 weeks and even more for maintenance. It enables login by many different platforms, together, even facebook. And it's absolutely easy to modify in every part.

shwaydogg replied on at Permalink Reply
@hiphopeagleeye, what did you end up doing? I looking at my options for social login as well (including @hanicker's plugin and something more custom like what you and @jordanlev proposes).

hiphopeagleeye replied on at Permalink Reply
I gave in and bought the plugin, even though I want to use Facebook registration and not connect. I don't have time to go figure it out. At the least I have working Facebook integration with many other 3rd party options. At the most, I can reengineer the code to do what I want.
shwaydogg replied on at Permalink Reply
Do you have a live site I could check out?
hiphopeagleeye replied on at Permalink Reply
Sorry I'm not sure why I'm only replying to this now, but no, not with the plugin. In any case, it didn't even work on my local server. I created a Facebook app and input the info, but all it did when I hit the register button was add a ?provider=Facebook to the end of the url. It does add a nice little control panel type thing when you're logged in and I'm modifying that.
hanicker replied on at Permalink Reply
Facebook does not allow connection from local server (eg. localhost). Maybe that was the problem.
Social Login works well on many sites. Have you tried latest version?