views:

32

answers:

1

I have created a java web application using spring. I want the users of my application can be logged automatically into my application when they are logged into facebook. Any help will be highly appreciated.

A: 

It depends of your app. BTW, facebook have good documentation about this, you have to use javascript auth (there are many examples), with manually processing result or using facebook-java-api (look at FacebookSignatureUtil for example).

PS you have to register your webapp at facebook before using facebook connect

splix
Thanks a lot for reply. I have managed to get the fb user id using access token with the help of the user. Now I want to get logged in fb user id with out access token.Actually I have saved the fb user id in my db. Now a user already logged into facebook visit my web application, and I don't want him to enter user name and password to login. For this purpose I need his fb user id. I have tried it with facebook java api without any success. Thanks in advance.
maybe i dont uderstand, but you need only "sign in with facebook" (facebook connect) button, an when user click on it it will be redirected to facebook, and back, with facebook credentials, And he is signed into your site after it. thats all.btw, if you want "user id", you can find it in this credentials
splix
It means every time user needs to sign in automatically he had to click that "facebook connect" link? Actually I was trying to get the user signed in without any click, but I think that's not possible.Thanks a lot for your help, so nice of you
yes, he have to click.btw, you can remember him using your own cookies and so on (using "remember me" from spring security, for example)
splix