File

auth-configuration/basic-settings/basic-auth-settings.component.ts

Metadata

Index

Properties
Methods
Inputs
Accessors

Constructor

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

Inputs

authConfiguration
Type : AuthConfiguration

Methods

add
add(collection)
Parameters :
Name Optional
collection No
Returns : void
forbiddenUserAgentsRemove
forbiddenUserAgentsRemove(id)
Parameters :
Name Optional
id No
Returns : void
ngDoCheck
ngDoCheck()
Returns : void
ngOnChanges
ngOnChanges(changes: SimpleChanges)
Parameters :
Name Type Optional
changes SimpleChanges No
Returns : void
trustedUserAgentsRemove
trustedUserAgentsRemove(id)
Parameters :
Name Optional
id No
Returns : void

Properties

preferredLoginOptionType
Type : TenantLoginOptionType
Default value : TenantLoginOptionType.BASIC
tenantLoginOptionTypeEnum
Default value : TenantLoginOptionType

Accessors

forbiddenWebBrowsers
getforbiddenWebBrowsers()
setforbiddenWebBrowsers(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
authenticationRestrictions
getauthenticationRestrictions()
<div
  class="card-block separator-top"
  *ngIf="authConfiguration.preferredLoginOptionType !== 'BASIC'"
>
  <div class="col-sm-2">
    <div class="h4 text-normal text-right text-left-xs">
      {{ 'Basic Auth restrictions' | translate }}
    </div>
  </div>

  <div class="col-sm-9">
    <div class="row">
      <div class="col-sm-6">
        <c8y-form-group>
          <label class="c8y-switch" title="{{ 'Forbidden for web browsers' | translate }}">
            <input type="checkbox" name="forbiddenWebBrowsers" [(ngModel)]="forbiddenWebBrowsers" />
            <span></span>
            <span>{{ 'Forbidden for web browsers' | translate }}</span>
          </label>
          <div
            class="alert alert-warning"
            *ngIf="
              preferredLoginOptionType === tenantLoginOptionTypeEnum.BASIC && forbiddenWebBrowsers
            "
          >
            {{
              'You are about to forbid browsers from using Basic authentication. This will prevent users from using web applications on your tenant because you are going to set Basic authentication as the preferred login mode.'
                | translate
            }}
          </div>
        </c8y-form-group>
      </div>
    </div>

    <div class="row">
      <div class="col-sm-6">
        <label title="{{ 'Forbidden user agents' | translate }}">
          {{ 'Forbidden user agents' | translate }}
        </label>
        <div
          class="input-group m-t-8"
          *ngFor="
            let forbiddenUserAgent of authenticationRestrictions.forbiddenUserAgents;
            last as isLast;
            first as isFirst
          "
        >
          <input
            type="text"
            [name]="'forbiddenUserAgent' + forbiddenUserAgent.id"
            [(ngModel)]="forbiddenUserAgent.value"
            class="form-control"
            data-cy="c8y-basic-auth--forbidden-agent"
            placeholder="{{ 'e.g.' | translate }} forbidden-agent"
          />
          <div class="input-group-btn col-sm-2">
            <button
              *ngIf="!(isFirst && isLast && forbiddenUserAgent.value === '')"
              title="{{ 'Remove' | translate }}"
              [name]="'forbiddenUserAgentRemove' + forbiddenUserAgent.id"
              type="button"
              class="btn btn-dot text-primary"
              (click)="forbiddenUserAgentsRemove(forbiddenUserAgent.id)"
            >
              <i class="dlt-c8y-icon-minus-circle text-danger"></i>
            </button>
            <button
              title="{{ 'Add' | translate }}"
              type="button"
              class="btn btn-dot text-primary"
              (click)="add(authenticationRestrictions.forbiddenUserAgents)"
              *ngIf="isLast"
            >
              <i class="dlt-c8y-icon-plus-circle"></i>
            </button>
          </div>
        </div>
      </div>
      <div class="col-sm-6">
        <label title="{{ 'Trusted user agents' | translate }}">
          {{ 'Trusted user agents' | translate }}
        </label>
        <div
          class="input-group m-t-8"
          *ngFor="
            let trustedUserAgent of authenticationRestrictions.trustedUserAgents;
            last as isLast;
            first as isFirst
          "
        >
          <input
            type="text"
            [name]="'trustedUserAgent' + trustedUserAgent.id"
            class="form-control"
            placeholder="{{ 'e.g.' | translate }} trusted-agent"
            data-cy="c8y-basic-auth--trusted-agent"
            [(ngModel)]="trustedUserAgent.value"
          />
          <div class="input-group-btn col-sm-2">
            <button
              *ngIf="!(isFirst && isLast && trustedUserAgent.value === '')"
              title="{{ 'Remove' | translate }}"
              [name]="'trustedUserAgentRemove' + trustedUserAgent.id"
              type="button"
              class="btn btn-dot btn-dot--danger text-primary"
              (click)="trustedUserAgentsRemove(trustedUserAgent.id)"
            >
              <i class="dlt-c8y-icon-minus-circle"></i>
            </button>
            <button
              title="{{ 'Add' | translate }}"
              type="button"
              (click)="add(authenticationRestrictions.trustedUserAgents)"
              class="btn btn-dot text-primary"
              *ngIf="isLast"
            >
              <i class="dlt-c8y-icon-plus-circle"></i>
            </button>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

results matching ""

    No results matching ""