2020-02-23 19:42:36 +00:00
|
|
|
import 'mocha';
|
|
|
|
import { expect } from 'chai';
|
|
|
|
import { GoogleLDAPAuth } from '../../src/auth/GoogleLDAPAuth';
|
|
|
|
|
2020-05-14 13:02:15 +00:00
|
|
|
describe('test google ldap auth', function () {
|
2020-02-23 19:42:36 +00:00
|
|
|
this.timeout(10000);
|
|
|
|
it('authenticate against ldap server', async () => {
|
|
|
|
const auth = new GoogleLDAPAuth({
|
|
|
|
base: 'dc=hokify,dc=com',
|
2020-05-14 13:02:15 +00:00
|
|
|
tls: {
|
|
|
|
keyFile: './ldap.gsuite.key',
|
|
|
|
certFile: './ldap.gsuite.crt',
|
|
|
|
},
|
2020-02-23 19:42:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
const result = await auth.authenticate('username', 'password');
|
|
|
|
|
|
|
|
expect(result).to.equal(true);
|
|
|
|
});
|
|
|
|
});
|