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 { ModelForm } from "../../../elements/forms/ModelForm"; 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 ModelForm { loadInstance(pk: number): Promise { return new ProvidersApi(DEFAULT_CONFIG).providersLdapRead({ id: pk, }); } getSuccessMessage(): string { if (this.instance) { return t`Successfully updated provider.`; } else { return t`Successfully created provider.`; } } send = (data: LDAPProvider): Promise => { if (this.instance) { return new ProvidersApi(DEFAULT_CONFIG).providersLdapUpdate({ id: this.instance.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.`}

`; } }