I hate the current sign in :(

0 views
Skip to first unread message

Brian Clifton

unread,
Dec 13, 2009, 10:14:36 PM12/13/09
to Google Friend Connect Developer Forum
Developers,

I am having a really hard time with GFC. I have full server side
integration working great. I based some of my code off the chowdown
example.

The problem I have is with signing in / signing out. There isn't a
really clean way to do it. There's javascript API, but it doesn't
work properly because my ASP.NET pages have a head element that is
runat="server" (I dynamically add the meta descriptions and page title
tags). This appears to cause the GFC divs to flicker and then the
javascript doesn't work.

I would like to propose a static GFC webpage. Something I can make my
sign in link point to. After the user signs in, it redirects to a
page of my choice. So for example, I would do something like...

<a href="http://google.com/gfc/signin?returnPath=http://mywebsite/
members.aspx">Sign In</a>

This would solve my problem of the javascript that must be run on my
page not working. Plus, it also makes certain the person is signed in
when they hit the webpage. Right now, if someone signs in, I can't
catch that event and force the webpage to refresh.

Can google developers make a static login page for GFC with
redirection?? Please! The popup is killing me :(
much appreciated
Brian

Alon Carmel

unread,
Dec 14, 2009, 1:47:45 PM12/14/09
to google-friend-co...@googlegroups.com
Then you better off use the Google Account api with OAUTH which has static signin pages and no Javascript work.
-
Cheers,
public static function AlonCarmel() {
//Contact me
var email = 'a...@aloncarmel.me';
var twitter = '@aloncarmel';
var web = 'http://aloncarmel.me';
var phone = '+972-54-4860380';
}

* If you received an unsolicited email from by mistake that wasn't of your matter please delete immediately. All E-mail sent from Alon Carmel is copyrighted to Alon Carmel 2008. Any details revealed in e-mails sent by Alon Carmel are owned by the Author only. Any attempt to duplicate or imitate any of the Content is prohibited under copyright law 2008.





--

You received this message because you are subscribed to the Google Groups "Google Friend Connect Developer Forum" group.
To post to this group, send email to google-friend-co...@googlegroups.com.
To unsubscribe from this group, send email to google-friend-connect-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-friend-connect-developers?hl=en.



Bob Aman

unread,
Dec 14, 2009, 4:01:53 PM12/14/09
to google-friend-co...@googlegroups.com
> Can google developers make a static login page for GFC with
> redirection?? Please!  The popup is killing me :(
> much appreciated

Unfortunately, no, we can't for security reasons. Alon is right, if
you need to do authentication like this, and you're just using GFC for
auth purposes, the Accounts API is a better choice. That API does
give you the capabilities you're looking for.

-Bob

Bob Aman

unread,
Dec 14, 2009, 4:28:00 PM12/14/09
to google-friend-co...@googlegroups.com
The Accounts API encompasses both OAuth and OpenID, and in all
likelihood, OpenID is what you want.

http://code.google.com/apis/accounts/

Mind if I take a look at the page you're working on? I might be able
to help you find a solution to your root problem.

-Bob Aman

Brian Clifton

unread,
Dec 14, 2009, 5:20:59 PM12/14/09
to Google Friend Connect Developer Forum
Hi Bob,

Absolutely... Here is a page with my proposed new design...
http://www.brianclifton.com/WebForm1.aspx

The link at the top, sign in... that is where a user can sign into the
page. It doesn't work right now, but this is where I choose:
-Use OAuth or..
-Use the friend connect widget

whichever is chosen, I want it to refresh the page (so I can load this
now authenticated user's menubars)

The page above does actually check your friend connect status using
cookies and OAuth against the REST API (I used the chow down
example). If you want to test a login, go to my live version of the
site:
http://www.brianclifton.com/

And use the login widget to follow my site and then go back to the new
proposed design...
http://www.brianclifton.com/WebForm1.aspx

You should see your name, your thumbnail, and a few options. Now,
instead of sign in, there is a sign out. When this is clicked, I want
the friend connect to be logged out and then have the page refreshed.
I'm guessing I'd have to use OAuth API for this also.

Thanks for looking at this Alon and Bob. I am trying to leverage
google utilities wherever possible. Will post my status here,
whatever the end solution is.

Bob Aman

unread,
Dec 14, 2009, 6:04:11 PM12/14/09
to google-friend-co...@googlegroups.com
> The link at the top, sign in... that is where a user can sign into the
> page.  It doesn't work right now, but this is where I choose:

Hmm, well, there's so little on the sign in page that I can't really
tell you anything based on what I see there. All I see is an
essentially empty page with a bit of ASP.net viewstate. Certainly
nothing GFC related.

From what I've seen so far, I guess I'm not sure why <head
runat="server"> would a major problem, since the GFC client-side
scripts don't have to be inserted into the page header, and in the
case of gadgets, generally aren't.

> The page above does actually check your friend connect status using
> cookies and OAuth against the REST API (I used the chow down
> example).  If you want to test a login, go to my live version of the
> site:
> http://www.brianclifton.com/
>
> And use the login widget to follow my site and then go back to the new
> proposed design...
> http://www.brianclifton.com/WebForm1.aspx
>
> You should see your name, your thumbnail, and a few options.

Yup, that seems to work just fine.

> Now, instead of sign in, there is a sign out.  When this is clicked, I want
> the friend connect to be logged out and then have the page refreshed.
> I'm guessing I'd have to use OAuth API for this also.

Sign-out server-side is as simple as clearing the fcauth cookie.
There's also the google.friendconnect.requestSignOut() function on the
client side.

-Bob Aman

Brian Clifton

unread,
Dec 14, 2009, 9:47:23 PM12/14/09
to Google Friend Connect Developer Forum
Wow, ok this is quite confusing...

I modified the OAuth code in chowdown to talk with the friendconnect
api URL...
http://www.google.com/friendconnect/api

For the time being, I only want to make sure someone can login (I
don't need access to any of their google account data). I registered
a domain with Google, but the next steps seem unclear

Here is the page I am looking at...
http://code.google.com/apis/gdata/articles/oauth.html

I am guessing I need to put all of the OAuth authentication parameters
in there and make the calls to the appropriate end points. Is this
going to make a cookie that is recognizable like my friend connect?
Can I specify my friend connect site as the scope?

Very puzzled :(

Brian Clifton

unread,
Dec 14, 2009, 9:50:09 PM12/14/09
to Google Friend Connect Developer Forum
Whoops, I might have responded prematurely...

Looks like OpenID is really what I need here. I am checking out the
documentation here...
http://code.google.com/apis/accounts/docs/OpenID.html#AuthProcess

Brian Clifton

unread,
Dec 15, 2009, 2:15:22 AM12/15/09
to Google Friend Connect Developer Forum
One last post for the night... (please ignore my two above)

I finally understand what OpenID and OAuth are all about. It's
actually really cool, but much more than I need.

I have GFC widgets all over my site and I like them. The only thing I
have a problem with is the sign in.

I've taken the time to fix my website. The "Sign out" now works
properly... I clear ASP.NET session data then expire the GFC cookie,
which essentially logs the user out. This works great. Please take a
look here:
http://www.brianclifton.com/WebForm1.aspx

The "Sign in" now works. It will display "loading..." then render a
button if you are not logged in. I like the popup, it works. The
only problem I have is; how can I tell when someone logged in? In the
case they actually do sign into Google, I want to refresh the current
page. Is there a callback method or something available in the JS
api? I would simply like to reload the page that I am already on in
the case of a sign in.

Once this is remedied, I will be really happy! Overall, GFC is
great. After digging into OAuth and the Google Account APIs, I want
to stay away from that for now. I would like to leverage everything
GFC has to offer.

Alon, Bob, what do you think about this latest post?

Bob Aman

unread,
Dec 15, 2009, 1:52:56 PM12/15/09
to google-friend-co...@googlegroups.com
> The "Sign in" now works.  It will display "loading..." then render a
> button if you are not logged in.  I like the popup, it works.  The
> only problem I have is; how can I tell when someone logged in?  In the
> case they actually do sign into Google, I want to refresh the current
> page.  Is there a callback method or something available in the JS
> api?  I would simply like to reload the page that I am already on in
> the case of a sign in.

Hehe, basically the same as the other guy's question. I like
questions I can answer with copy and paste!

google.friendconnect.container.initOpenSocialApi

See the http://code.google.com/apis/friendconnect/js_api.html documentation.

The onload callback for that function is called whenever the user
signs in or signs out.

See also: http://code.google.com/apis/ajax/playground/#sign-in_sign-out

-Bob

Brian Clifton

unread,
Dec 19, 2009, 9:34:14 PM12/19/09
to Google Friend Connect Developer Forum
Hi Bob,

I want to thank you! That worked perfectly. I've almost completed my
integration with GFC.

I took my site design live and it heavily uses GFC
http://www.brianclifton.com/

For example, I have video game reviews:
http://www.brianclifton.com/nes/GameDetail.aspx?GameID=94

And here's a buyer's guide I wrote for a car:
http://www.brianclifton.com/mb/cars/r129/

I'm just starting to implement the recommend feature. You can see one
of the gadgets here (when it's done, will move to front page) along
with a newsletter gadget
http://www.brianclifton.com/WebForm1.aspx

Love GFC!! Good job

Thanks
Brian

Reply all
Reply to author
Forward
0 new messages