feat(console): u2f (#1080)

* fix user table count

* grpc ge

* move grpc

* u2f

* add u2f funcs

* rm local grpc, u2f dialog

* dialog u2f

* 2fa button

* mfa u2f credentialoptions

* decode base64 to bytearray, id, challenge

* u2f verify

* spinner, remove, attribute col

* delete mfa

* add forcemfa to policy

* add id to remove

* fix: add missing remove u2f in management

* user mgmt u2f delete, login policy

* rm log

* show attr in mgmt user mfa

* add missing id of mfa

* mfa table

* multifaktor for admin, org

* add secondfactor to gen component

* remove circular dependency

* lint

* revert identity prov

* add divider

* login policy lint

* Update console/src/app/modules/policies/login-policy/login-policy.component.html

* Update console/src/app/modules/policies/login-policy/login-policy.component.html

Co-authored-by: Maximilian Peintner <[email protected]>
Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
Max Peintner
2020-12-14 10:04:15 +01:00
committed by GitHub
co-authored by Maximilian Peintner Livio Amstutz
parent cd44213e99
commit c6fed8ae86
33 changed files with 972 additions and 65 deletions
+37
View File
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import { Empty } from 'google-protobuf/google/protobuf/empty_pb';
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
import { BehaviorSubject } from 'rxjs';
import { MultiFactorsResult } from '../proto/generated/admin_pb';
import {
AddMachineKeyRequest,
@@ -50,6 +51,7 @@ import {
MachineKeySearchResponse,
MachineKeyType,
MachineResponse,
MultiFactor,
NotificationType,
OIDCApplicationCreate,
OIDCConfig,
@@ -122,6 +124,8 @@ import {
ProjectView,
RemoveOrgDomainRequest,
RemoveOrgMemberRequest,
SecondFactor,
SecondFactorsResult,
SetPasswordNotificationRequest,
UpdateMachineRequest,
UpdateUserAddressRequest,
@@ -152,6 +156,7 @@ import {
UserSearchResponse,
UserView,
ValidateOrgDomainRequest,
WebAuthNTokenID,
ZitadelDocs,
} from '../proto/generated/management_pb';
import { GrpcService } from './grpc.service';
@@ -185,6 +190,32 @@ export class ManagementService {
return this.grpcService.mgmt.searchIdps(req);
}
public GetLoginPolicyMultiFactors(): Promise<MultiFactorsResult> {
const req = new Empty();
return this.grpcService.mgmt.getLoginPolicyMultiFactors(req);
}
public AddMultiFactorToLoginPolicy(req: MultiFactor): Promise<MultiFactor> {
return this.grpcService.mgmt.addMultiFactorToLoginPolicy(req);
}
public RemoveMultiFactorFromLoginPolicy(req: MultiFactor): Promise<Empty> {
return this.grpcService.mgmt.removeMultiFactorFromLoginPolicy(req);
}
public GetLoginPolicySecondFactors(): Promise<SecondFactorsResult> {
const req = new Empty();
return this.grpcService.mgmt.getLoginPolicySecondFactors(req);
}
public AddSecondFactorToLoginPolicy(req: SecondFactor): Promise<SecondFactor> {
return this.grpcService.mgmt.addSecondFactorToLoginPolicy(req);
}
public RemoveSecondFactorFromLoginPolicy(req: SecondFactor): Promise<Empty> {
return this.grpcService.mgmt.removeSecondFactorFromLoginPolicy(req);
}
public GetLoginPolicy(): Promise<LoginPolicyView> {
const req = new Empty();
return this.grpcService.mgmt.getLoginPolicy(req);
@@ -683,6 +714,12 @@ export class ManagementService {
return this.grpcService.mgmt.removeMfaOTP(req);
}
public RemoveMfaU2F(id: string): Promise<Empty> {
const req = new WebAuthNTokenID();
req.setId(id);
return this.grpcService.mgmt.removeMfaU2F(req);
}
public SaveUserProfile(
id: string,
firstName?: string,