Skip to content

Commit 48d7955

Browse files
committed
feat: add rejectUnauthorized option
1 parent b2f4020 commit 48d7955

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ auth:
1919
baseDN: 'dc=sample,dc=local'
2020
domainSuffix: 'sample.local'
2121
groupName: 'npmWriters' # optional
22+
rejectUnauthorized: true
2223
```
2324
2425
Alternatively, if your config.yaml uses multiple security groups, you can provide a yaml sequence:

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ function Plugin(config, stuff) {
1414
Plugin.prototype.authenticate = function(user, password, callback) {
1515
var self = this;
1616
var username = user + '@' + this._config.domainSuffix;
17-
18-
var connection = new ActiveDirectory(_.extend(this._config, { username: username, password: password }));
17+
18+
var rejectUnauthorized = (typeof self._config.rejectUnauthorized !== 'undefined') ? self._config.rejectUnauthorized : true;
19+
20+
var connection = new ActiveDirectory(_.extend(this._config, { username: username, password: password, tlsOptions: { rejectUnauthorized: rejectUnauthorized } }));
1921
connection.on('error', function(error) {
2022
self._logger.warn('Active Directory connection error. Error:', error);
2123
});

0 commit comments

Comments
 (0)