https://github.com/roppa/ntlm-auth
Test app for authentication/authorisation with NTLM and AD
https://github.com/roppa/ntlm-auth
Last synced: about 1 year ago
JSON representation
Test app for authentication/authorisation with NTLM and AD
- Host: GitHub
- URL: https://github.com/roppa/ntlm-auth
- Owner: roppa
- Created: 2016-08-09T10:46:36.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-15T16:23:06.000Z (almost 10 years ago)
- Last Synced: 2025-02-14T18:36:27.063Z (over 1 year ago)
- Language: JavaScript
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#Authentication and Authorisation example
Still very much a work in progress. We want to create an authentication/authorisation service that can use NTLM or fall back on some other service.
The idea is to just have a series of middleware that is configurable and chained.
For example:
1. Authenticate over NTLM (unfortunately)
2. Get user details from AD
3. Store users details from above in JWT
4. Send 200
##Setup
The app uses dotenv-safe for development. Create a .env file at the root of the application and add the following:
```
PORT=8070
SECRET='TOTALLYAWESOMESECRET'
DOMAIN_NAME='TESTDOMAIN'
DIRECTORY_SYSTEM_AGENT='ldap://0.0.0.0:1389'
#LDAP
LDAP_ADMIN='cn=root'
LDAP_SECRET='secret'
LDAP_ACCOUNT_NAME='testorg'
LDAP_ACCESS_GROUP='dc=example,dc=com,o=example'
```
If the app is running then it needs access to an ldap server. To spin one up for testing:
1. run node
2. run ```let server = require('./mocks/ldapServer');```
3. run ```server.start(1389, () => {});```
##Testing
Run ```mocha```. This spins up a dev LDAP server.