Pia Palackathadom
Pia Palackathadom

Reputation: 95

How to get the logged in user's facebook ID?

I am using facebook connect to allow users to log-in to my site using facebook. I am using the server side authentication using OAuth in classic ASP, vbscript. I want to know if one of the following is possible:

1) Can I identify if the user has authorized my app without redirecting to the Auth dialog? ie, even before the user clicks the facebook login button to log-in to my site, is there a way I can find out if the user who is currently logged into facebook has authorized my app?

2) How can I get the facebook user Id of the user who is currently logged into facebook? This is outside the facebook authentication process. Does facebook offer some api which I can use to read the fb cookie that is set when a user logs into facebook and get the logged-in users's facebook user id?

Thanks

Upvotes: 0

Views: 997

Answers (1)

C3roe
C3roe

Reputation: 96306

1) Use FB.getLoginStatus from the JavaScript SDK.

2) If he’s not connected to your app yet, then not at all. Otherwise, see 1)

Upvotes: 1

Related Questions