The user ID returned by the Google API are different when the same user with the same Google account login into using Google Friend Connect and Google iGoogle

4 views
Skip to first unread message

Hung.Nguyen

unread,
Dec 17, 2009, 12:07:43 AM12/17/09
to Google Friend Connect Developer Forum
I have two websites. The first is a standalone website and it use the
Google Friend Connect to allow user to login into my site using his/
her Google account. The second is an iGoogle gadget (it embeded into
an iframe, follow the iGoogle Gadget documentation).
When user login into the iGoogle gadget, follow the iGoogle Developer
Guide, I use this code snippet to get the current user ID:
function onLoadMyWebSite(data)
{
var viewer = data.get('viewer').getData();
document.getElementById("ifEric").src="http://mywebsite.com/" +
viewer.getId();
}

And when user login int the standlone website using Google Friend
Connect, also follow the Google Friend Connect developer guide, I send
the Rest call to get the user profiles, which involve the user ID:
http://www.google.com/friendconnect/api/people/@viewer/@self?fcauth=

The problem is that the same user with the same Google account (For
example a Gmail account) login into both the sites, the User IDs
return by the Google Friend Connect API and the Google Gadget API is
different. It might be Google don't know it's the same user.

Is there anyone has seen the same problem ? Please help me
Thanks in advanced.

Bob Aman

unread,
Dec 17, 2009, 12:45:11 AM12/17/09
to google-friend-co...@googlegroups.com
> The problem is that the same user with the same Google account (For
> example a Gmail account) login into both the sites, the User IDs
> return by the Google Friend Connect API and the Google Gadget API is
> different. It might be Google don't know it's the same user.

GFC encompasses more than just Google accounts. You can sign in with
Twitter or Yahoo or AOL or OpenID. There's no way to tell that these
are the same user automatically and sign them in for both places.

-Bob

Hung.Nguyen

unread,
Dec 17, 2009, 6:17:13 PM12/17/09
to Google Friend Connect Developer Forum
> GFC encompasses more than just Google accounts.  You can sign in with
> Twitter or Yahoo or AOL or OpenID.  There's no way to tell that these
> are the same user automatically and sign them in for both places.

I know the Google Friend Connect popup have some buttons allow user to
login using his/her Google or Twitter or Yahoo account. When the
Google Friend Connect popup appears and then I choose Google or
Twitter or other ones, I think the API definitely know current user
logging-in using Google or Twitter or Yahoo account etc... On the
popup, when I click on the Google button, of course the API know I'm a
Google user, when I click on the Twitter button, of course the API
know I'm a Twitter user etc... So why doesn't the API return the user
ID with a prefix to differentiate which the social network user belong
to ?

For example:
- If I click on the Google button to login-> the user ID returned by
the API might look like "google_xxxxxxxxx". And in this case, the
string xxxxxxxxx shoud be the same with the user ID return by the API
when I host my application as a iGoogle Gadget.
- If I click on the Twitter button to login-> the user ID returned by
the API might look like "twitter_yyyyyyyyy"

etc...

And if I login by choosing the Twitter button, how can I get the
Twitter friends list of current user ? The same question if I login by
choosing the Yahoo button ? I think it's very useful if the API
support for that.

Thank your response

Bob Aman

unread,
Dec 17, 2009, 7:12:47 PM12/17/09
to google-friend-co...@googlegroups.com
> I know the Google Friend Connect popup have some buttons allow user to
> login using his/her Google or Twitter or Yahoo account. When the
> Google Friend Connect popup appears and then I choose Google or
> Twitter or other ones, I think the API definitely know current user
> logging-in using Google or Twitter or Yahoo account etc... On the
> popup, when I click on the Google button, of course the API know I'm a
> Google user, when I click on the Twitter button, of course the API
> know I'm a Twitter user etc... So why doesn't the API return the user
> ID with a prefix to differentiate which the social network user belong
> to ?

I don't think that gives you what you initially asked for.
Authentication for both pieces is a more involved process than just
passing around an identifier. If you're interested, I'd recommend
reading about the OAuth specification:
http://oauth.net/documentation/getting-started/

-Bob

Aaron

unread,
Dec 17, 2009, 9:32:34 PM12/17/09
to Google Friend Connect Developer Forum
Hi Bob,
apologies Hung may not have been clear. More specifically the issue
is this:

We have built a site that leverages GFC, Facebook Connect and Twitter
as possible options to login into the site. We have built an igoogle
and Facebook Flash based versions of the site also. The igoogle
widget leverages GFC, and Facebook widget leverages FC. The site is
based around User Generated Content, with the ability to review and
share with friends lists etc.

When a user logs onto the site or the FB widget using Facebook Connect
we are presented with the same UID, the user has the same profile, can
reivew generated content and the same friends list.

However we have found that the UID presented by GFC and iGoogle using
the same Google account is different. This creates the challenge that
if the same user logs into the site via the widget or website our
application sees the user as different, therefore the user profile is
different and content that is developed via the Widget can not be
reviewed via the primary website, and vica versa.

Any assistance you could provide would be greatly appreciated.

Cheers

Aaron Dormer.

Bob Aman

unread,
Dec 18, 2009, 2:25:02 PM12/18/09
to google-friend-co...@googlegroups.com
> Hi Bob,
> apologies Hung may not have been clear.  More specifically the issue
> is this:
>
> We have built a site

Link? Having the actual site in front of me always helps to
understand what you're trying to do a bit better.

> that leverages GFC, Facebook Connect and Twitter
> as possible options to login into the site. We have built an igoogle
> and Facebook Flash based versions of the site also.  The igoogle
> widget leverages GFC, and Facebook widget leverages FC.  The site is
> based around User Generated Content, with the ability to review and
> share with friends lists etc.
>
> When a user logs onto the site or the FB widget using Facebook Connect
> we are presented with the same UID, the user has the same profile, can
> reivew generated content and the same friends list.
>
> However we have found that the UID presented by GFC and iGoogle using
> the same Google account is different.  This creates the challenge that
> if the same user logs into the site via the widget or website our
> application sees the user as different, therefore the user profile is
> different and content that is developed via the Widget can not be
> reviewed via the primary website, and vica versa.
>
> Any assistance you could provide would be greatly appreciated.

What I would recommend is that you build your gadget using the Friend
Connect container instead. This document should help explain how to
accomplish that:

http://code.google.com/apis/friendconnect/gadgets.html

-Bob Aman

Reply all
Reply to author
Forward
0 new messages