2 # Test a username/password combination towards the LDAP server specified in config/authentication.yml
5 abort
"Usage: #{$0} username password"
8 require "./config/environment"
12 ldap
= Gitorious
::Authentication::Configuration.authentication_method('LDAP')
14 abort
"You need to configure LDAP autentication in config/authentication.yml" unless ldap
16 if ldap
.valid_credentials
?(username
, password
)
17 puts
"All good, your credentials are correct"
20 puts
"For debugging purposes, this is the DN we tried: #{ldap.build_username(username)}"