Skip to content

Commit

Permalink
Merge pull request #17 from jupyterhub/better-logging
Browse files Browse the repository at this point in the history
Add more verbose logging for login failures
  • Loading branch information
minrk committed Aug 26, 2016
2 parents 77e89e5 + 1015b70 commit 6b35a19
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ldapauthenticator/ldapauthenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def _server_port_default(self):


allowed_groups = List(
config=True,
help="List of LDAP Group DNs whose members are allowed access"
config=True,
help="List of LDAP Group DNs whose members are allowed access"
)

valid_username_regex = Unicode(
Expand Down Expand Up @@ -92,8 +92,15 @@ def authenticate(self, handler, data):
attributes=['member']
):
return username
# If we reach here, then none of the groups matched
self.log.warn('User {username} not in any of the allowed groups'.format(
username=userdn
))
return None
else:
return username
else:
self.log.warn('Invalid password')
self.log.warn('Invalid password for user {username}'.format(
username=userdn,
))
return None

0 comments on commit 6b35a19

Please sign in to comment.