diff --git a/src/user/user.service.ts b/src/user/user.service.ts index 8558e6a..42aac6b 100644 --- a/src/user/user.service.ts +++ b/src/user/user.service.ts @@ -39,6 +39,7 @@ export class UserService { sn: "", mail: "", avatarurl: "", + userPassword: user.password, }); entries.push(personEntry); diff --git a/src/utils/ldap.ts b/src/utils/ldap.ts index 76a9825..bccb093 100644 --- a/src/utils/ldap.ts +++ b/src/utils/ldap.ts @@ -1,4 +1,5 @@ import {ldapConfig} from "../ldap.config"; +import {createHash} from "crypto"; export function getRootDN() { return ldapConfig.rootDN; @@ -64,6 +65,7 @@ export function makePersonEntry(dn, attrs) { // }; // const generatedDN = makeOrganizationUnitEntryDN(dn); const generatedDN = makeDN(dn, getRootDN()); + attrs.userPassword = createHash('md5').update(attrs.userPassword).digest('hex'); return { dn: generatedDN, attributes: Object.assign({