You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
574 B

import 'mocha';
import { expect } from 'chai';
import { LDAPAuth } from '../../src/auth/LDAPAuth';
describe('test ldap auth', function () {
this.timeout(10000);
it('authenticate against ldap server', async () => {
const auth = new LDAPAuth({
url: 'ldaps://ldap.google.com:636',
base: 'dc=hokify,dc=com',
tls: {
keyFile: './ldap.gsuite.key',
certFile: './ldap.gsuite.crt',
},
tlsOptions: {
servername: 'ldap.google.com',
},
});
const result = await auth.authenticate('username', 'password');
expect(result).to.equal(true);
});
});