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?
      client_id=***************&
      redirect_uri=http://localhost/index.php/register/do_register/&
      fields=[
      {'name':'name'},
      {'name':'email'},
      {'name':'location'},
      {'name':'gender'},
      {'name':'birthday'},
      {'name':'password'},
      {'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'},
      {'name':'captcha'}]"
   scrolling="auto"

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

timtorres
 
timtorres replied on at Permalink Reply
timtorres
Bumpppppppp
timtorres replied on at Permalink Reply
timtorres
Bump...
jordanlev replied on at Permalink Reply
jordanlev
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:
http://www.concrete5.org/community/forums/themes/customizing-login-...

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

Good luck!

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

You need that before any page inserts.
timtorres replied on at Permalink Reply
timtorres
@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
Steevb
Sorry, different type of FB integration±!

This might help:

http://www.domagojsalopek.com/Details/Create-a-Registration-and-Log...
timtorres replied on at Permalink Reply
timtorres
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
hanicker
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:
http://25labs.com/tutorial-integrate-facebook-connect-to-your-websi...

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.

Regards
Nick
shwaydogg replied on at Permalink Reply
shwaydogg
@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).

Thanks!
timtorres replied on at Permalink Reply
timtorres
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
shwaydogg
Do you have a live site I could check out?
timtorres replied on at Permalink Reply
timtorres
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
hanicker
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?