8

Which Java library do you recommend to implement authentication in a Java web app (just servlets & JSPs)? We want to offer the most common authentication providers (Facebook, Yahoo, Gmail, etc.) and also local account registration.

I have found SocialAuth but it looks pretty new and I don't know if there are better alternatives. In addition, it looks like SocialAuth will request access to users contacts which I don't need and could annoy our users.

Thanks!

Óscar
  • 650
  • 1
  • 4
  • 16

3 Answers3

2

You can checkout the newer version of SocialAuth, u can set the level of permissions to be asked from the users.

helloworld
  • 2,179
  • 3
  • 24
  • 39
0

Spring Security is a good starting point to get a flexible authentication system in your project.

http://static.springsource.org/spring-security/site/

There is a spring-security-facebook plugin that will integrate facebook auth.

http://code.google.com/p/spring-security-facebook/

I'm not sure about the others specifically. If you are talking about OpenID then spring security supports that.

Mike
  • 8,853
  • 3
  • 35
  • 44
  • But as I said it is a plain Servlets + JSP application. We are not using Spring. We would like to use a standalone library, just for authentication. – Óscar Dec 14 '10 at 16:53
  • 1
    It is possible to use spring security and spring without any of the web mvc stuff. Though, it would almost be more trouble to avoid all of the dependencies then it is worth not adopting it all. The the facebook spring security module uses a java facebook library that you could leverage. http://code.google.com/p/facebook-java-api/ – Mike Dec 14 '10 at 16:56
  • 1
    Looking at SocialAuth, it looks more up your ally then anything else I know of. – Mike Dec 14 '10 at 17:02
0

I ended up using openid4java to integrate Google and Yahoo OpenId, and plain HttpClient calls to integrate OAuth based services (Facebook and Hotmail).

Óscar
  • 650
  • 1
  • 4
  • 16