mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-10 05:13:17 +00:00
conditional settings for ldap ad
This commit is contained in:
@@ -100,42 +100,46 @@
|
|||||||
<label for="interval">{{'interval' | i18n}}</label>
|
<label for="interval">{{'interval' | i18n}}</label>
|
||||||
<input type="number" min="5" class="form-control" id="interval" name="Interval" [(ngModel)]="sync.interval" placeholder="{{'ex' | i18n}} 5">
|
<input type="number" min="5" class="form-control" id="interval" name="Interval" [(ngModel)]="sync.interval" placeholder="{{'ex' | i18n}} 5">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
|
||||||
<label for="memberAttribute">{{'memberAttribute' | i18n}}</label>
|
|
||||||
<input type="text" class="form-control" id="memberAttribute" name="MemberAttribute" [(ngModel)]="sync.memberAttribute" placeholder="{{'ex' | i18n}} member">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="creationDateAttribute">{{'creationDateAttribute' | i18n}}</label>
|
|
||||||
<input type="text" class="form-control" id="creationDateAttribute" name="CreationDateAttribute" [(ngModel)]="sync.creationDateAttribute"
|
|
||||||
placeholder="{{'ex' | i18n}} whenCreated">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="revisionDateAttribute">{{'revisionDateAttribute' | i18n}}</label>
|
|
||||||
<input type="text" class="form-control" id="revisionDateAttribute" name="RevisionDateAttribute" [(ngModel)]="sync.revisionDateAttribute"
|
|
||||||
placeholder="{{'ex' | i18n}} whenChanged">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="checkbox" id="removeDisabled" [(ngModel)]="sync.removeDisabled" name="RemoveDisabled">
|
<input class="form-check-input" type="checkbox" id="removeDisabled" [(ngModel)]="sync.removeDisabled" name="RemoveDisabled">
|
||||||
<label class="form-check-label" for="removeDisabled">{{'removeDisabled' | i18n}}</label>
|
<label class="form-check-label" for="removeDisabled">{{'removeDisabled' | i18n}}</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div [hidden]="directory != directoryType.Ldap">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="memberAttribute">{{'memberAttribute' | i18n}}</label>
|
||||||
|
<input type="text" class="form-control" id="memberAttribute" name="MemberAttribute" [(ngModel)]="sync.memberAttribute" placeholder="{{'ex' | i18n}} member">
|
||||||
|
</div>
|
||||||
|
<div [hidden]="ldap.ad">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="creationDateAttribute">{{'creationDateAttribute' | i18n}}</label>
|
||||||
|
<input type="text" class="form-control" id="creationDateAttribute" name="CreationDateAttribute" [(ngModel)]="sync.creationDateAttribute"
|
||||||
|
placeholder="{{'ex' | i18n}} whenCreated">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="revisionDateAttribute">{{'revisionDateAttribute' | i18n}}</label>
|
||||||
|
<input type="text" class="form-control" id="revisionDateAttribute" name="RevisionDateAttribute" [(ngModel)]="sync.revisionDateAttribute"
|
||||||
|
placeholder="{{'ex' | i18n}} whenChanged">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="checkbox" id="useEmailPrefixSuffix" [(ngModel)]="sync.useEmailPrefixSuffix" name="UseEmailPrefixSuffix">
|
|
||||||
<label class="form-check-label" for="useEmailPrefixSuffix">{{'useEmailPrefixSuffix' | i18n}}</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div [hidden]="!sync.useEmailPrefixSuffix">
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="emailPrefixAttribute">{{'emailPrefixAttribute' | i18n}}</label>
|
<div class="form-check">
|
||||||
<input type="text" class="form-control" id="emailPrefixAttribute" name="EmailPrefixAttribute" [(ngModel)]="sync.emailPrefixAttribute"
|
<input class="form-check-input" type="checkbox" id="useEmailPrefixSuffix" [(ngModel)]="sync.useEmailPrefixSuffix" name="UseEmailPrefixSuffix">
|
||||||
placeholder="{{'ex' | i18n}} sAMAccountName">
|
<label class="form-check-label" for="useEmailPrefixSuffix">{{'useEmailPrefixSuffix' | i18n}}</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div [hidden]="!sync.useEmailPrefixSuffix">
|
||||||
<label for="emailSuffix">{{'emailSuffix' | i18n}}</label>
|
<div class="form-group" [hidden]="ldap.ad">
|
||||||
<input type="text" class="form-control" id="emailSuffix" name="EmailSuffix" [(ngModel)]="sync.emailSuffix" placeholder="{{'ex' | i18n}} @company.com">
|
<label for="emailPrefixAttribute">{{'emailPrefixAttribute' | i18n}}</label>
|
||||||
|
<input type="text" class="form-control" id="emailPrefixAttribute" name="EmailPrefixAttribute" [(ngModel)]="sync.emailPrefixAttribute"
|
||||||
|
placeholder="{{'ex' | i18n}} sAMAccountName">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="emailSuffix">{{'emailSuffix' | i18n}}</label>
|
||||||
|
<input type="text" class="form-control" id="emailSuffix" name="EmailSuffix" [(ngModel)]="sync.emailSuffix" placeholder="{{'ex' | i18n}} @company.com">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -150,18 +154,20 @@
|
|||||||
<label for="userFilter">{{'userFilter' | i18n}}</label>
|
<label for="userFilter">{{'userFilter' | i18n}}</label>
|
||||||
<textarea class="form-control" id="userFilter" name="UserFilter" [(ngModel)]="sync.userFilter" placeholder="{{'ex' | i18n}} (&(objectClass=user))"></textarea>
|
<textarea class="form-control" id="userFilter" name="UserFilter" [(ngModel)]="sync.userFilter" placeholder="{{'ex' | i18n}} (&(objectClass=user))"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div [hidden]="directory != directoryType.Ldap">
|
||||||
<label for="userObjectClass">{{'userObjectClass' | i18n}}</label>
|
<div class="form-group">
|
||||||
<input type="text" class="form-control" id="userObjectClass" name="UserObjectClass" [(ngModel)]="sync.userObjectClass" placeholder="{{'ex' | i18n}} user">
|
<label for="userObjectClass">{{'userObjectClass' | i18n}}</label>
|
||||||
</div>
|
<input type="text" class="form-control" id="userObjectClass" name="UserObjectClass" [(ngModel)]="sync.userObjectClass" placeholder="{{'ex' | i18n}} user">
|
||||||
<div class="form-group">
|
</div>
|
||||||
<label for="userPath">{{'userPath' | i18n}}</label>
|
<div class="form-group" [hidden]="ldap.ad">
|
||||||
<input type="text" class="form-control" id="userPath" name="UserPath" [(ngModel)]="sync.userPath" placeholder="{{'ex' | i18n}} CN=Users">
|
<label for="userPath">{{'userPath' | i18n}}</label>
|
||||||
</div>
|
<input type="text" class="form-control" id="userPath" name="UserPath" [(ngModel)]="sync.userPath" placeholder="{{'ex' | i18n}} CN=Users">
|
||||||
<div class="form-group">
|
</div>
|
||||||
<label for="userEmailAttribute">{{'userEmailAttribute' | i18n}}</label>
|
<div class="form-group">
|
||||||
<input type="text" class="form-control" id="userEmailAttribute" name="UserEmailAttribute" [(ngModel)]="sync.userEmailAttribute"
|
<label for="userEmailAttribute">{{'userEmailAttribute' | i18n}}</label>
|
||||||
placeholder="{{'ex' | i18n}} mail">
|
<input type="text" class="form-control" id="userEmailAttribute" name="UserEmailAttribute" [(ngModel)]="sync.userEmailAttribute"
|
||||||
|
placeholder="{{'ex' | i18n}} mail">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -176,19 +182,21 @@
|
|||||||
<label for="groupFilter">{{'groupFilter' | i18n}}</label>
|
<label for="groupFilter">{{'groupFilter' | i18n}}</label>
|
||||||
<textarea class="form-control" id="groupFilter" name="GroupFilter" [(ngModel)]="sync.groupFilter" placeholder="{{'ex' | i18n}} (&(objectClass=group))"></textarea>
|
<textarea class="form-control" id="groupFilter" name="GroupFilter" [(ngModel)]="sync.groupFilter" placeholder="{{'ex' | i18n}} (&(objectClass=group))"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div [hidden]="directory != directoryType.Ldap">
|
||||||
<label for="groupObjectClass">{{'groupObjectClass' | i18n}}</label>
|
<div class="form-group">
|
||||||
<input type="text" class="form-control" id="groupObjectClass" name="GroupObjectClass" [(ngModel)]="sync.groupObjectClass"
|
<label for="groupObjectClass">{{'groupObjectClass' | i18n}}</label>
|
||||||
placeholder="{{'ex' | i18n}} group">
|
<input type="text" class="form-control" id="groupObjectClass" name="GroupObjectClass" [(ngModel)]="sync.groupObjectClass"
|
||||||
</div>
|
placeholder="{{'ex' | i18n}} group">
|
||||||
<div class="form-group">
|
</div>
|
||||||
<label for="groupPath">{{'groupPath' | i18n}}</label>
|
<div class="form-group" [hidden]="ldap.ad">
|
||||||
<input type="text" class="form-control" id="groupPath" name="GroupPath" [(ngModel)]="sync.groupPath" placeholder="{{'ex' | i18n}} CN=Groups">
|
<label for="groupPath">{{'groupPath' | i18n}}</label>
|
||||||
</div>
|
<input type="text" class="form-control" id="groupPath" name="GroupPath" [(ngModel)]="sync.groupPath" placeholder="{{'ex' | i18n}} CN=Groups">
|
||||||
<div class="form-group">
|
</div>
|
||||||
<label for="groupNameAttribute">{{'groupNameAttribute' | i18n}}</label>
|
<div class="form-group">
|
||||||
<input type="text" class="form-control" id="groupNameAttribute" name="GroupNameAttribute" [(ngModel)]="sync.groupNameAttribute"
|
<label for="groupNameAttribute">{{'groupNameAttribute' | i18n}}</label>
|
||||||
placeholder="{{'ex' | i18n}} name">
|
<input type="text" class="form-control" id="groupNameAttribute" name="GroupNameAttribute" [(ngModel)]="sync.groupNameAttribute"
|
||||||
|
placeholder="{{'ex' | i18n}} name">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -56,6 +56,14 @@ export class SettingsComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
|
if (this.ldap.ad) {
|
||||||
|
this.sync.creationDateAttribute = 'whenCreated';
|
||||||
|
this.sync.revisionDateAttribute = 'whenChanged';
|
||||||
|
this.sync.emailPrefixAttribute = 'sAMAccountName';
|
||||||
|
this.sync.groupPath = 'CN=Users';
|
||||||
|
this.sync.userPath = 'CN=Users';
|
||||||
|
}
|
||||||
|
|
||||||
await this.configurationService.saveDirectoryType(this.directory);
|
await this.configurationService.saveDirectoryType(this.directory);
|
||||||
await this.configurationService.saveDirectory(DirectoryType.Ldap, this.ldap);
|
await this.configurationService.saveDirectory(DirectoryType.Ldap, this.ldap);
|
||||||
await this.configurationService.saveDirectory(DirectoryType.GSuite, this.gsuite);
|
await this.configurationService.saveDirectory(DirectoryType.GSuite, this.gsuite);
|
||||||
|
|||||||
@@ -321,9 +321,6 @@
|
|||||||
"password": {
|
"password": {
|
||||||
"message": "Password"
|
"message": "Password"
|
||||||
},
|
},
|
||||||
"thisIsActiveDirectory": {
|
|
||||||
"message": "This is an Active Directory LDAP server."
|
|
||||||
},
|
|
||||||
"type": {
|
"type": {
|
||||||
"message": "Type"
|
"message": "Type"
|
||||||
},
|
},
|
||||||
@@ -331,7 +328,7 @@
|
|||||||
"message": "Directory"
|
"message": "Directory"
|
||||||
},
|
},
|
||||||
"currentUser": {
|
"currentUser": {
|
||||||
"message": "Authenticate as current user"
|
"message": "Authenticate as current system user"
|
||||||
},
|
},
|
||||||
"rootPath": {
|
"rootPath": {
|
||||||
"message": "Root Path"
|
"message": "Root Path"
|
||||||
@@ -364,7 +361,7 @@
|
|||||||
"message": "Interval (in minutes)"
|
"message": "Interval (in minutes)"
|
||||||
},
|
},
|
||||||
"removeDisabled": {
|
"removeDisabled": {
|
||||||
"message": "Remove disabled users"
|
"message": "Remove disabled users during sync"
|
||||||
},
|
},
|
||||||
"memberAttribute": {
|
"memberAttribute": {
|
||||||
"message": "Member Attribute"
|
"message": "Member Attribute"
|
||||||
@@ -376,7 +373,7 @@
|
|||||||
"message": "Revision Date Attribute"
|
"message": "Revision Date Attribute"
|
||||||
},
|
},
|
||||||
"useEmailPrefixSuffix": {
|
"useEmailPrefixSuffix": {
|
||||||
"message": "Use email prefix/suffix"
|
"message": "If a user has no email address, combine a username prefix with a suffix value to form an email"
|
||||||
},
|
},
|
||||||
"emailPrefixAttribute": {
|
"emailPrefixAttribute": {
|
||||||
"message": "Email Prefix Attribute"
|
"message": "Email Prefix Attribute"
|
||||||
@@ -418,10 +415,10 @@
|
|||||||
"message": "Sync"
|
"message": "Sync"
|
||||||
},
|
},
|
||||||
"ldapSsl": {
|
"ldapSsl": {
|
||||||
"message": "This connection uses SSL (LDAPS)"
|
"message": "This server uses SSL (LDAPS)"
|
||||||
},
|
},
|
||||||
"ldapAd": {
|
"ldapAd": {
|
||||||
"message": "This LDAP server is Active Directory"
|
"message": "This server uses Active Directory"
|
||||||
},
|
},
|
||||||
"select": {
|
"select": {
|
||||||
"message": "Select"
|
"message": "Select"
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export class ConfigurationService {
|
|||||||
if (savedConfig.privateKey == null) {
|
if (savedConfig.privateKey == null) {
|
||||||
await this.secureStorageService.remove(Keys.gsuite);
|
await this.secureStorageService.remove(Keys.gsuite);
|
||||||
} else {
|
} else {
|
||||||
(config as any).privateKey = savedConfig.privateKey =
|
(config as GSuiteConfiguration).privateKey = savedConfig.privateKey =
|
||||||
savedConfig.privateKey.replace(/\\n/g, '\n');
|
savedConfig.privateKey.replace(/\\n/g, '\n');
|
||||||
await this.secureStorageService.save(Keys.gsuite, savedConfig.privateKey);
|
await this.secureStorageService.save(Keys.gsuite, savedConfig.privateKey);
|
||||||
savedConfig.privateKey = StoredSecurely;
|
savedConfig.privateKey = StoredSecurely;
|
||||||
|
|||||||
Reference in New Issue
Block a user