Question

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
Was it helpful?

Solution

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.

OTHER TIPS

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...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top