ldap-jwt
ldap-jwt copied to clipboard
Lightweight node.js based web service that provides user authentication against LDAP server (Active Directory / Windows network) credentials and returns a JSON Web Token.
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
- Rename/Copy
config.test.jsontoconfig.json - Update config in
config.json - 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": "[email protected]"
}
ToDo
- Write Tests