import { FlowDesignationEnum, FlowsApi, ProvidersApi, LDAPProvider, CoreApi } from "authentik-api"; import { t } from "@lingui/macro"; import { customElement, property } from "lit-element"; import { html, TemplateResult } from "lit-html"; import { DEFAULT_CONFIG } from "../../../api/Config"; import { Form } from "../../../elements/forms/Form"; import { until } from "lit-html/directives/until"; import { ifDefined } from "lit-html/directives/if-defined"; import "../../../elements/forms/HorizontalFormElement"; import "../../../elements/forms/FormGroup"; import { first } from "../../../utils"; @customElement("ak-provider-ldap-form") export class LDAPProviderFormPage extends Form { set providerUUID(value: number) { new ProvidersApi(DEFAULT_CONFIG).providersLdapRead({ id: value, }).then(provider => { this.provider = provider; }); } @property({attribute: false}) provider?: LDAPProvider; getSuccessMessage(): string { if (this.provider) { return t`Successfully updated provider.`; } else { return t`Successfully created provider.`; } } send = (data: LDAPProvider): Promise => { if (this.provider) { return new ProvidersApi(DEFAULT_CONFIG).providersLdapUpdate({ id: this.provider.pk || 0, data: data }); } else { return new ProvidersApi(DEFAULT_CONFIG).providersLdapCreate({ data: data }); } }; renderForm(): TemplateResult { return html`

${t`Flow used for users to authenticate. Currently only identification and password stages are supported.`}

${t`Users in the selected group can do search queries.`}

${t`Protocol settings`}

${t`LDAP DN under which bind requests and search requests can be made.`}

`; } }