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="col-md-12 p-t-16">
  <div class="row m-l-8 m-r-8 m-b-8">
    <div class="col-xs-12 col-sm-3 col-md-2">
      <h4 class="text-normal text-right text-left-xs" translate>Signature verification</h4>
    </div>
    <div class="col-xs-12 col-sm-9 col-md-10 col-lg-9">
      <div class="row">
        <div class="col-sm-6">
          <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>
      </div>

      <div id="adfs" *ngIf="templateModel.signatureVerificationConfig.certificateTypeChosen === certificateType.ADFS">
        <div 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>

      <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">
        <c8y-form-group *ngIf="templateModel.signatureVerificationConfig.manual.customCertificates.length > 1">
          <div class="legend form-block" translate>Manual</div>
          <div class="row">
            <div class="col-sm-6">
              <label for="certIdField" class="control-label">
                {{ 'Certificate ID field' | translate }}
                <button
                  class="btn btn-clean text-info"
                  popover-trigger="'focus'"
                  popover="{{ CERTIFICATE_ID_FIELD_POPOVER | translate }}"
                  placement="right"
                  [outsideClick]="true"
                >
                  <i c8yIcon="question-circle-o"></i>
                </button>
              </label>
              <input
                type="text"
                class="form-control"
                name="certIdField"
                id="certIdField"
                [(ngModel)]="templateModel.signatureVerificationConfig.manual.certIdField"
                required
              />
            </div>
          </div>
        </c8y-form-group>

        <div>
          <div class="legend form-block" translate>Certificates</div>
          <div *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
                      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>
                  </label>
                </c8y-form-group>
              </div>
            </div>

            <div class="row">
              <div class="col-sm-6">
                <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-sm-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"
                      placeholder="{{ 'Date from' | translate }}"
                      [bsConfig]="{ customTodayClass: 'today' }"
                      [maxDate]="customCertificate.validTill"
                      bsDatepicker
                      required
                    />
                  </c8y-form-group>
                </div>
              </div>
              <div class="col-sm-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 }}"
                      [bsConfig]="{ customTodayClass: 'today' }"
                      bsDatepicker
                      [minDate]="customCertificate.validFrom"
                      required
                    />
                  </c8y-form-group>
                </div>
              </div>
            </div>
            <div class="form-group" *ngIf="templateModel.signatureVerificationConfig.manual.customCertificates.length > 1">
              <button
                title="{{ 'Delete certificate' | translate }}"
                class="btn btn-danger btn-sm hidden-xs"
                (click)="removeCustomCertificate(customCertificate)"
                type="button"
              >
                <i c8yIcon="minus-circle"></i>
                <span>{{ 'Delete certificate' | translate }}</span>
              </button>

              <button
                title="{{ 'Delete certificate' | translate }}"
                class="btn btn-danger btn-block btn-sm visible-xs"
                (click)="removeCustomCertificate(customCertificate)"
                type="button"
              >
                <i c8yIcon="minus-circle"></i>
                <span>{{ 'Delete certificate' | translate }}</span>
              </button>
            </div>
            <div class="separator-top p-b-24" *ngIf="templateModel.signatureVerificationConfig.manual.customCertificates.length > 1"></div>
          </div>
          <button
            title="{{ 'Add certificate' | translate }}"
            class="btn-add-block m-t-8"
            (click)="templateModel.signatureVerificationConfig.manual.addCustomCertificate()"
            name="addCertificate"
          >
            <i c8yIcon="plus-circle"></i>
            <span>{{ 'Add certificate' | translate }}</span>
          </button>
        </div>
      </div>
    </div>
  </div>
</div>

results matching ""

    No results matching ""