Question

I'm developing a little website using the Playframework with Scala, and I need to add authentication and authorization to my site. My professor told me to check LDAP. So I checked and I didn't found something interesting except a discussion in Google groups here.

I found this module too https://github.com/t2v/play20-auth but i couldn't understand well its code.

So i'm asking this: Is it possible to use LDAP with the Playframework and Scala ? If so is there a tutorial that can help me to start?

Was it helpful?

Solution

LDAP can be used for accessing Directory Services. A directoty/catalog can be used as storage for usernames and passwords, but probably overkill if you are just storing usernames and passwords since they best fit enterprise scale and have lots of other features. The most normal use case I know of is not authenticating directly with LDAP(Though fully possible), but using it for authorization to get the roles for the user from eg. Active Directory combined with SSO (Eg. kerberos/ntlm authentication).

To use it you should check out a ldap client library(eg. http://www.springsource.org/ldap) in your authentication and/or authorization code.

You mention this is a "little website" and I think LDAP might be overkill for your case. If it is a small site you should use a ready made module like you mentioned and persist to database with hashed and salted passwords. If you want to use LDAP then you should check out OpenDJ(http://forgerock.com/what-we-offer/open-identity-stack/opendj/) if you are looking for a clean and simple LDAP directory service.

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