Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect if already logged in with OpenID and bypass web app login page

I would like to know the best way of implementing automatic login to my web site. What I mean by automatic is this:

I've already signed into Google. I now go to my web site and its login page. Instead of clicking on the link to login with Google I would like the web app to detect that I'm already logged into Google and bypass the whole login page.

1) Would I use the DotNetOpenAuth.OpenId.RelyingParty.OpenIdAjaxRelyingParty.HttpApplicationStore to get associations?

2) Or do I need to look at cookies.

like image 943
cackster Avatar asked Nov 14 '22 06:11

cackster


1 Answers

To your "1) Associations" guess, no. Associations that the RP may already have with Google are irrelevant to who the user is at the browser or whether they're logged into Google. Your "2) cookies" won't work either because browser isolate Google's cookies from those of your RP so you have no insight into that.

Hbas was right. I think Auto Login user to website when user is logged in to FB or google - DotNetOpenAuth has the answer to your question.

Distant memory suggests that Google had a way to disclosing to an RP that the user was logged into a Google account (with no way to identify which user or auto-login that user) with the idea being that the RP could then promote the "login with Google" button since you know the user has a Google account. However that wasn't well advertised (privacy concerns probably) and I can't find any info on it at the moment.

like image 54
Andrew Arnott Avatar answered Jan 20 '23 01:01

Andrew Arnott