Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Login with facebook in Spring MVC application?

I want to integrate facebook login into my web application developed using Spring MVC. What are the ways to do it?

  • Can I simply add the javascript and iframe of login button on my website?
  • Does facebook gives me details of the users such as username, hometown, university etc? Please provide appropriate link or tutorial
like image 509
RickDavis Avatar asked Jun 23 '12 13:06

RickDavis


2 Answers

If you want to get those pieces of information, like username... you will have to write some piece of code in your backend to handle the facebook callback.

As you are using Spring, how about you give it a try at Spring Social? http://www.springsource.org/spring-social

Looks easy to use.

like image 55
Arthur Neves Avatar answered Nov 07 '22 02:11

Arthur Neves


1) First go to the https://developers.facebook.com and create your account and get your appId and appSecret;
2) Go to autoconfig and provide your appId and appSecret in your .net MVC application
3) In developer of Facebook add your redirect URI (Products -> Add Product) which will look like this http://localhost.....
4) In your product on developer console, enable the required functionalities, which will be:

  • Client OAuth Login
  • Web OAuth Login

(OPTIONAL - If you want to publish the app)
5) Than in developer of facebook go to the app review
6) Choose yes to make it live
7) Enjoy..... hope it works! If you have any question ask me...

like image 20
sanket parikh Avatar answered Nov 07 '22 03:11

sanket parikh