Skip to content

Lightweight node.js based web service that provides user authentication against LDAP server (Active Directory / Windows network) credentials and returns a JSON Web Token.

License

lucianweber/ldap-jwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple "ldap-jwt" service

Lightweight node.js based web service that provides user authentication against LDAP server (Active Directory / Windows network) credentials and returns a JSON Web Token.

Heavily based on the work of gregfroese/ldapservice.

Changes

  • Replaced yaml config-files with json
  • Removed support for RabbitMQ
  • Updated npm dependencies
  • Simplified endpoints

Usage

  1. Rename/Copy config.test.json to config.json
  2. Update config in config.json
  3. Deploy

Endpoints

/authenticate

Payload

{
    "username": "euler",
    "password": "password"
}

Response

{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NjE3OTQxMjY0NjAsInVzZXJfbmFtZSI6ImV1bGVyIiwiZnVsbF9uYW1lIjoiTGVvbmhhcmQgRXVsZXIiLCJtYWlsIjoiZXVsZXJAbGRhcC5mb3J1bXN5cy5jb20ifQ.bqSjshvLnHsTJwcXBXsNVtGGNatvQHyqhL8MSXuMwFI",
  "full_name": "Leonhard Euler"
}

/verify

Payload

{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NjE3OTQxMjY0NjAsInVzZXJfbmFtZSI6ImV1bGVyIiwiZnVsbF9uYW1lIjoiTGVvbmhhcmQgRXVsZXIiLCJtYWlsIjoiZXVsZXJAbGRhcC5mb3J1bXN5cy5jb20ifQ.bqSjshvLnHsTJwcXBXsNVtGGNatvQHyqhL8MSXuMwFI"
}

Response

{
  "exp": 1495058246,
  "user_name": "euler",
  "full_name": "Leonhard Euler",
  "mail": "euler@ldap.forumsys.com"
}

ToDo

  • Write Tests

About

Lightweight node.js based web service that provides user authentication against LDAP server (Active Directory / Windows network) credentials and returns a JSON Web Token.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published