Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LDAP for authentication and authorization in Playframework 2.0

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?

like image 497
Marouane Lakhal Avatar asked Oct 02 '12 12:10

Marouane Lakhal


1 Answers

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.

like image 99
col Avatar answered Oct 12 '22 02:10

col