Forum: Ruby on Rails conceptual confusion with facebook connect

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
dino d. (Guest)
on 2009-01-13 00:26
(Received via mailing list)
Slightly off topic, but I'm exploring FB connect integration with my
rails site.

Right now I have an application with a User model, and that user model
links to all of my other models, such as comments, votes, etc.  As I
understand it, FB connect lets users log in without having to log in
to my site.  So what do I do, just create a pseudo user for each
facebook connect login?

Alternatively, can I / should I have existing users associate their FB
accounts with my site's user accounts?

If two users log in to my site using only FB connect, and they're
friends on FB, is there any way for me to tell that?

Thanks for any advice/input.

Dino
Conrad T. (Guest)
on 2009-01-13 00:41
(Received via mailing list)
On Mon, Jan 12, 2009 at 2:25 PM, dino d. <removed_email_address@domain.invalid> 
wrote:

>
> Slightly off topic, but I'm exploring FB connect integration with my
> rails site.
>
> Right now I have an application with a User model, and that user model
> links to all of my other models, such as comments, votes, etc.  As I
> understand it, FB connect lets users log in without having to log in
> to my site.  So what do I do, just create a pseudo user for each
> facebook connect login?
>

This really depends on how you configure your site.  If you use the
privacy
controls that's provided by the framework, then they would be properly
authenticated
to your site as they are to facebook.com.


>
> Alternatively, can I / should I have existing users associate their FB
> accounts with my site's user accounts?


> If two users log in to my site using only FB connect, and they're
> friends on FB, is there any way for me to tell that?
>

I would highly recommend reading the development documents at

http://wiki.developers.facebook.com/index.php/Face...

Also, you'll find a live demo here:

http://www.somethingtoputhere.com/therunaround

Good luck,

-Conrad
dino d. (Guest)
on 2009-01-13 04:23
(Received via mailing list)
Thanks Conrad.  I'm still confused though.   I have a model called
User that has the following:

has_many :comments

Now, when my user logs in and leaves a comment, I say something like

comment = Comment.new
...
user.comments << comment

Now, suppose a Facebook user authenticates with FB connect.  Now
what?  How do I keep track of this users comments?

I've read both of those links but they don't really address how you
treat a facebook user as a data point in your site.
dino d. (Guest)
on 2009-01-13 13:28
(Received via mailing list)
I'm getting closer to an answer, I found this link which talks about
linking accounts (your users and facebook users):

http://wiki.developers.facebook.com/index.php/Acco...

If I get this working, I'll post an update.

Dino
This topic is locked and can not be replied to.