File

auth-configuration/sso-configuration/template-parts/signature-configuration.component.ts

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor(controlContainer: ControlContainer)
Parameters :
Name Type Optional
controlContainer ControlContainer No

Inputs

templateModel
Type : any

Methods

removeCustomCertificate
removeCustomCertificate(customCertificate: CustomCertificate)
Parameters :
Name Type Optional
customCertificate CustomCertificate No
Returns : void
shouldShow
shouldShow(field: string)
Decorators :
@memoize()
Parameters :
Name Type Optional
field string No
Returns : boolean

Properties

algorithmTypes
Default value : algorithmTypeConfig
CERTIFICATE_ID_FIELD_POPOVER
Default value : gettext( 'This is the name of the field in the token whose value will be used to select one of the certificates below which has matching "Certificate ID value".' )
certificateType
Default value : CertificateType
certificateTypes
Default value : certificateTypeConfig
<div class="p-24">
  <div class="row">
    <div class="col-xs-12 col-sm-3 col-md-2">
      <div
        class="h4 text-normal text-right text-left-xs"
        translate
      >
        Signature verification
      </div>
    </div>
    <div class="col-xs-12 col-sm-9 col-md-10 col-lg-9">
      <div
        *ngIf="shouldShow('certificateType')"
        class="form-group p-relative"
      >
        <div class="row">
          <div class="col-sm-6">
            <label
              for="certificateType"
              class="control-label"
              translate
            >
              Verifier
            </label>
            <div class="c8y-select-wrapper">
              <select
                class="form-control"
                id="certificateType"
                name="certificateType"
                [(ngModel)]="templateModel.signatureVerificationConfig.certificateTypeChosen"
              >
                <option
                  *ngFor="let certificateType of certificateTypes | keyvalue"
                  [ngValue]="certificateType.key"
                >
                  {{ certificateType.value.label | translate }}
                </option>
              </select>
              <span></span>
            </div>
          </div>
        </div>
      </div>
      <div
        id="adfs"
        *ngIf="
          templateModel.signatureVerificationConfig.certificateTypeChosen === certificateType.ADFS
        "
        class="row"
      >
        <div class="col-sm-6">
          <c8y-form-group>
            <label
              for="adfsManifestUrl"
              class="control-label"
              translate
            >
              ADFS manifest URL
            </label>
            <input
              type="url"
              class="form-control"
              required
              [placeholder]="
                'e.g. {{ example }}'
                  | translate
                    : {
                        example: 'https://adfs.tenant.com/federationmetadata/federationmetadata.xml'
                      }
              "
              [(ngModel)]="templateModel.signatureVerificationConfig.adfsManifest.manifestUrl"
              name="adfsManifestUrl"
              id="adfsManifestUrl"
            />
          </c8y-form-group>
        </div>
      </div>

      <div
        id="add"
        *ngIf="
          templateModel.signatureVerificationConfig.certificateTypeChosen === certificateType.AZURE
        "
      >
        <div class="row">
          <div class="col-sm-6">
            <c8y-form-group>
              <label
                for="publicKeyDiscoveryUrl"
                class="control-label"
                translate
              >
                Public key discovery URL
              </label>
              <input
                type="url"
                id="publicKeyDiscoveryUrl"
                class="form-control"
                required
                [placeholder]="
                  'e.g. {{ example }}'
                    | translate
                      : { example: 'https://login.microsoftonline.de/tenant/discovery/keys' }
                "
                name="publicKeyDiscoveryUrl"
                [(ngModel)]="templateModel.signatureVerificationConfig.aad.publicKeyDiscoveryUrl"
              />
            </c8y-form-group>
          </div>
        </div>
      </div>

      <div
        id="jwks"
        *ngIf="
          templateModel.signatureVerificationConfig.certificateTypeChosen === certificateType.JWKS
        "
      >
        <div class="row">
          <div class="col-sm-6">
            <c8y-form-group>
              <label
                for="jwksPublicKeyDiscoveryUrl"
                class="control-label"
                translate
              >
                JWKS URL
              </label>
              <input
                type="url"
                class="form-control"
                id="jwksPublicKeyDiscoveryUrl"
                required
                [placeholder]="
                  'e.g. {{ example }}' | translate: { example: 'http://www.example.com/' }
                "
                name="jwksUri"
                [(ngModel)]="templateModel.signatureVerificationConfig.jwks.jwksUri"
              />
            </c8y-form-group>
          </div>
        </div>
      </div>

      <div
        id="manual"
        *ngIf="
          templateModel.signatureVerificationConfig.certificateTypeChosen === certificateType.CUSTOM
        "
      >
        <fieldset
          class="c8y-fieldset p-24"
          *ngIf="templateModel.signatureVerificationConfig.manual.customCertificates.length > 1"
        >
          <legend>
            {{ 'Manual' | translate }}
          </legend>
          <div class="row">
            <div class="col-md-6">
              <label
                for="certIdField"
                class="control-label"
              >
                {{ 'Certificate ID field' | translate }}
                <button
                  class="btn-help btn-help--sm"
                  type="button"
                  [attr.aria-label]="'Help' | translate"
                  popover="{{ CERTIFICATE_ID_FIELD_POPOVER | translate }}"
                  placement="right"
                  triggers="focus"
                ></button>
              </label>
              <input
                type="text"
                class="form-control"
                name="certIdField"
                id="certIdField"
                [(ngModel)]="templateModel.signatureVerificationConfig.manual.certIdField"
                required
              />
            </div>
          </div>
        </fieldset>

        <fieldset class="c8y-fieldset p-24">
          <legend>
            {{ 'Certificates' | translate }}
          </legend>
          <fieldset
            class="c8y-fieldset p-16"
            *ngFor="
              let customCertificate of templateModel.signatureVerificationConfig.manual
                .customCertificates;
              index as crtIndex
            "
          >
            <div class="row">
              <div
                class="col-sm-6"
                *ngIf="
                  templateModel.signatureVerificationConfig.manual.customCertificates.length > 1
                "
              >
                <c8y-form-group>
                  <label
                    [for]="'customCertificateValue' + crtIndex"
                    class="control-label"
                    translate
                  >
                    Certificate ID value
                  </label>
                  <input
                    [name]="'customCertificateValue' + crtIndex"
                    [id]="'customCertificateValue' + crtIndex"
                    type="text"
                    class="form-control"
                    [(ngModel)]="customCertificate.key"
                    required
                  />
                </c8y-form-group>
              </div>
              <div class="col-sm-6">
                <c8y-form-group>
                  <label class="control-label">
                    {{ 'Type' | translate }}
                  </label>
                  <label
                    title="{{ algorithmType.value.label | translate }}"
                    class="c8y-radio input-sm"
                    *ngFor="let algorithmType of algorithmTypes | keyvalue; index as algIndex"
                  >
                    <input
                      type="radio"
                      [name]="'alg' + crtIndex + algIndex"
                      [value]="algorithmType.key"
                      [(ngModel)]="customCertificate.alg"
                    />
                    <span></span>
                    <span>{{ algorithmType.value.label | translate }}</span>
                  </label>
                </c8y-form-group>
              </div>
            </div>

            <div class="row">
              <div class="col-md-5">
                <c8y-form-group>
                  <label
                    class="control-label"
                    [for]="'publicKey' + crtIndex"
                    *ngIf="customCertificate.alg === algorithmTypes.PCKS.value"
                    translate
                  >
                    Certificate in PEM format
                  </label>
                  <label
                    class="control-label"
                    [for]="'publicKey' + crtIndex"
                    *ngIf="customCertificate.alg === algorithmTypes.RSA.value"
                    translate
                  >
                    Public key in PEM format
                  </label>
                  <input
                    [name]="'publicKey' + crtIndex"
                    [id]="'publicKey' + crtIndex"
                    type="text"
                    class="form-control"
                    [(ngModel)]="customCertificate.publicKey"
                    required
                  />
                </c8y-form-group>
              </div>
              <div class="col-md-3">
                <div class="form-group datepicker">
                  <c8y-form-group>
                    <label
                      [for]="'validFromPicker' + crtIndex"
                      class="control-label"
                    >
                      {{ 'Valid from' | translate }}
                    </label>
                    <input
                      [name]="'validFromPicker' + crtIndex"
                      [id]="'validFromPicker' + crtIndex"
                      [(ngModel)]="customCertificate.validFrom"
                      class="form-control"
                      [attr.aria-label]="'Date from' | translate"
                      placeholder="{{ 'Date from' | translate }}"
                      [bsConfig]="{ customTodayClass: 'today', adaptivePosition: true }"
                      [maxDate]="customCertificate.validTill"
                      bsDatepicker
                      required
                    />
                  </c8y-form-group>
                </div>
              </div>
              <div class="col-md-3">
                <div class="form-group datepicker">
                  <c8y-form-group>
                    <label
                      [for]="'validTillPicker' + crtIndex"
                      class="control-label"
                    >
                      {{ 'Valid till' | translate }}
                    </label>
                    <input
                      [name]="'validTillPicker' + crtIndex"
                      [id]="'validTillPicker' + crtIndex"
                      [(ngModel)]="customCertificate.validTill"
                      class="form-control"
                      placeholder="{{ 'Date to' | translate }}"
                      [attr.aria-label]="'Date to' | translate"
                      [bsConfig]="{ customTodayClass: 'today', adaptivePosition: true }"
                      bsDatepicker
                      [minDate]="customCertificate.validFrom"
                      required
                    />
                  </c8y-form-group>
                </div>
              </div>
              <div
                class="col-md-1"
                *ngIf="
                  templateModel.signatureVerificationConfig.manual.customCertificates.length > 1
                "
              >
                <label>&nbsp;</label>
                <button
                  class="btn btn-danger btn-sm visible-xs visible-sm"
                  type="button"
                  title="{{ 'Delete certificate' | translate }}"
                  (click)="removeCustomCertificate(customCertificate)"
                >
                  <i
                    c8yIcon="minus-circle"
                    class="m-r-4"
                  ></i>
                  <span>{{ 'Delete certificate' | translate }}</span>
                </button>

                <button
                  class="btn btn-dot btn-dot--danger visible-md visible-lg"
                  type="button"
                  tooltip="{{ 'Delete certificate' | translate }}"
                  placement="top"
                  [adaptivePosition]="false"
                  [attr.aria-label]="'Delete certificate' | translate"
                  [delay]="300"
                  (click)="removeCustomCertificate(customCertificate)"
                >
                  <i c8yIcon="minus-circle"></i>
                </button>
              </div>
            </div>
          </fieldset>
          <button
            class="btn btn-default m-t-8"
            type="button"
            title="{{ 'Add certificate' | translate }}"
            (click)="templateModel.signatureVerificationConfig.manual.addCustomCertificate()"
            name="addCertificate"
          >
            <i
              c8yIcon="plus-circle"
              class="m-r-4"
            ></i>
            <span>{{ 'Add certificate' | translate }}</span>
          </button>
        </fieldset>
      </div>
    </div>
  </div>
</div>

results matching ""

    No results matching ""