2 ~ Licensed to the Apache Software Foundation (ASF) under one
3 ~ or more contributor license agreements. See the NOTICE file
4 ~ distributed with this work for additional information
5 ~ regarding copyright ownership. The ASF licenses this file
6 ~ to you under the Apache License, Version 2.0 (the
7 ~ "License"); you may not use this file except in compliance
8 ~ with the License. You may obtain a copy of the License at
10 ~ http://www.apache.org/licenses/LICENSE-2.0
11 ~ Unless required by applicable law or agreed to in writing,
12 ~ software distributed under the License is distributed on an
13 ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 ~ KIND, either express or implied. See the License for the
15 ~ specific language governing permissions and limitations
19 <form class="mt-3 mb-3" [formGroup]="userForm" (ngSubmit)="onSubmit()" autocomplete="new-password">
20 <p class="row col-md-10">{{'security.config.ldap.explain'|translate}}</p>
21 <div class="form-group row col-md-10"
22 *ngFor="let attName of ['host_name','port','base_dn','groups_base_dn','bind_dn','bind_password']">
23 <label class="col-md-3 col-form-label"
26 [ngbTooltip]="'security.config.ldap.attdesc.'+attName|translate" placement="top"
27 >{{'security.config.ldap.attributes.' + attName |translate}}</label>
28 <div [attr.class]="attName=='port'?'col-md-2':'col-md-7'">
29 <input [attr.type]="attName=='bind_password'?'password':'text'" formControlName="{{attName}}"
31 [ngClass]="getInputClasses(attName)"
32 autocomplete="new-password"
36 <div class="form-group row col-md-10">
37 <label class="col-md-3 col-form-label"
39 [openDelay]="500" [ngbTooltip]="'security.config.ldap.attdesc.context_factory'|translate" placement="top"
40 >{{'security.config.ldap.attributes.context_factory' |translate}}</label>
41 <div class="col-md-7">
42 <input type="text" formControlName="context_factory" id="context_factory"
43 [ngClass]="getInputClasses('context_factory')" [ngbTypeahead]="searchContextFactory"
48 <div class="form-group row col-md-10">
49 <label class="col-md-3 col-form-label"
50 for="authentication_method"
51 [openDelay]="500" [ngbTooltip]="'security.config.ldap.attdesc.authentication_method'|translate" placement="top"
52 >{{'security.config.ldap.attributes.authentication_method' |translate}}</label>
53 <div class="col-md-2">
54 <select formControlName="authentication_method" id="authentication_method" class="form-control">
55 <option *ngFor="let method of authenticationMethods">{{method}}</option>
59 <div class="form-group row col-md-10">
60 <div class="col-md-3">{{'security.config.ldap.flags'|translate}}</div>
61 <div class="col-md-7">
62 <div class="form-check pt-1 pb-1"
63 *ngFor="let flagName of ['writable','ssl_enabled','bind_authenticator_enabled','use_role_name_as_group']">
64 <input class="form-check-input" type="checkbox" formControlName="{{flagName}}"
66 <label class="form-check-label " for="{{flagName}}"
67 [openDelay]="500" [ngbTooltip]="'security.config.ldap.attdesc.'+flagName|translate" placement="top"
69 {{'security.config.ldap.attributes.' + flagName|translate}}
74 <div class="form-group row col-md-10" >
76 [openDelay]="500" [ngbTooltip]="'security.config.ldap.attdesc.properties'|translate" placement="top"
77 >{{'security.config.ldap.attributes.properties'|translate}}</div>
78 <div class="col-md-7 form-row">
79 <input type="text" id="prop_key" formControlName="prop_key" class="form-control col" placeholder="{{'form.button.key'|translate}}"
82 <input type="prop_value" id="prop_value" formControlName="prop_value"
83 class="form-control col" placeholder="{{'form.button.value'|translate}}">
84 <button type="button" class="ml-2 btn btn-primary col" (click)="addProperty()">{{'form.button.add'|translate}}</button>
87 <div class="form-group row col-md-10" *ngIf="ldapProperties && ldapProperties.size>0">
88 <div class="col-md-3"></div>
89 <div class="col-md-7 pl-2 list-group">
90 <div class="list-group-item" *ngFor="let propEntry of ldapProperties |keyvalue">
91 <span class="float-left">{{propEntry.key}}={{propEntry.value}}</span>
92 <a class="float-right" [routerLink]="" (click)="removeProperty(propEntry.key)" ><i class="fas fa-trash-alt"></i></a>
98 <div class="row col-md-10 mt-5">
99 <button class="btn btn-primary col-md-3" type="submit"
100 [disabled]="checkProgress|| userForm.invalid || !userForm.dirty">{{'form.button.save'|translate}}</button>
101 <button class="btn btn-primary col-md-3 offset-1" type="button" (click)="checkLdapConnection()"
102 [disabled]="checkProgress||userForm.invalid">
103 <span *ngIf="checkProgress" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
104 <span *ngIf="checkProgress"> {{'form.button.checking'|translate}}</span>
105 <span *ngIf="!checkProgress">{{'form.button.check'|translate}}</span></button>
107 <div class="row col-md-10 mt-2">
108 <div class="alert col-md-6 ml-1 alert-success" role="alert"
109 *ngIf="submitError">{{'security.config.ldap.submit_error'|translate:{error:submitError.toString()} }}</div>
110 <div class="alert col-md-6 ml-1 alert-success" role="alert"
111 *ngIf="checkResult=='success'">{{'security.config.ldap.check_success'|translate}}</div>
112 <div class="alert col-md-6 ml-1 alert-warning" role="alert"
113 *ngIf="checkResult=='error'">{{'security.config.ldap.check_failed'|translate}}</div>