# Conceptual confusion with facebook connect

**URL:** <https://www.ruby-forum.com/t/conceptual-confusion-with-facebook-connect/157540>\
**Category:** Rails\
**Created:** [January 12, 2009, 11:26pm UTC](https://www.ruby-forum.com/t/conceptual-confusion-with-facebook-connect/157540 "2009-01-12T23:26:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [January 12, 2009, 11:26pm UTC](https://www.ruby-forum.com/t/conceptual-confusion-with-facebook-connect/157540/1 "2009-01-12T23:26:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [January 12, 2009, 11:41pm UTC](https://www.ruby-forum.com/t/conceptual-confusion-with-facebook-connect/157540/2 "2009-01-12T23:41:17Z")

</div>

On Mon, Jan 12, 2009 at 2:25 PM, dino d. [removed\_email\_address@domain.invalid](mailto: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](http://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/Facebook\_Connect](http://wiki.developers.facebook.com/index.php/Facebook_Connect)

Also, you’ll find a live demo here:

[http://www.somethingtoputhere.com/therunaround](http://www.somethingtoputhere.com/therunaround)

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [January 13, 2009, 3:23am UTC](https://www.ruby-forum.com/t/conceptual-confusion-with-facebook-connect/157540/3 "2009-01-13T03:23:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dino\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dino\_d](https://www.ruby-forum.com/u/dino_d)\
**Post date:** [January 13, 2009, 12:28pm UTC](https://www.ruby-forum.com/t/conceptual-confusion-with-facebook-connect/157540/4 "2009-01-13T12:28:12Z")

</div>

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/Account\_Linking](http://wiki.developers.facebook.com/index.php/Account_Linking)

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

Dino
