i'm developing a website with Spring MVC and Spring Security and JAVA backend. Actually it has an authentication process on local database with username and password. Now, i have to add facebook authentication. The final solution should be like the authentication process of stackoverflow. The user must be able to choose between local authentication and Facebook authentication (with the option to share content of the website on his facebook profile). I've seen standard js solution of Facebook, but it seems to be incompatible with spring security and local authentication.
Can someone help me, possibly with some guide or tutorial?