import { SAMLSource, SourcesApi, BindingTypeEnum, NameIdPolicyEnum, CryptoApi, DigestAlgorithmEnum, SignatureAlgorithmEnum, FlowsApi, FlowsInstancesListDesignationEnum, } from "@goauthentik/api"; import { t } from "@lingui/macro"; import { customElement } from "lit-element"; import { html, TemplateResult } from "lit-html"; import { DEFAULT_CONFIG } from "../../../api/Config"; import "../../../elements/forms/FormGroup"; import "../../../elements/forms/HorizontalFormElement"; import { ifDefined } from "lit-html/directives/if-defined"; import { until } from "lit-html/directives/until"; import { first } from "../../../utils"; import { ModelForm } from "../../../elements/forms/ModelForm"; @customElement("ak-source-saml-form") export class SAMLSourceForm extends ModelForm { loadInstance(pk: string): Promise { return new SourcesApi(DEFAULT_CONFIG).sourcesSamlRetrieve({ slug: pk, }); } getSuccessMessage(): string { if (this.instance) { return t`Successfully updated source.`; } else { return t`Successfully created source.`; } } send = (data: SAMLSource): Promise => { if (this.instance) { return new SourcesApi(DEFAULT_CONFIG).sourcesSamlUpdate({ slug: this.instance.slug, sAMLSourceRequest: data, }); } else { return new SourcesApi(DEFAULT_CONFIG).sourcesSamlCreate({ sAMLSourceRequest: data, }); } }; renderForm(): TemplateResult { return html`
${t`Protocol settings`}

${t`URL that the initial Login request is sent to.`}

${t`Optional URL if the IDP supports Single-Logout.`}

${t`Also known as Entity ID. Defaults the Metadata URL.`}

${t`Keypair which is used to sign outgoing requests. Leave empty to disable signing.`}

${t`Advanced protocol settings`}

${t`Allows authentication flows initiated by the IdP. This can be a security risk, as no validation of the request ID is done.`}

${t`Time offset when temporary users should be deleted. This only applies if your IDP uses the NameID Format 'transient', and the user doesn't log out manually. (Format: hours=1;minutes=2;seconds=3).`}

${t`Flow settings`}

${t`Flow used before authentication.`}

${t`Flow to use when authenticating existing users.`}

${t`Flow to use when enrolling new users.`}

`; } }