mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-18 19:25:13 +00:00
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:
co-authored by
Maximilian Peintner
Livio Amstutz
parent
cd44213e99
commit
c6fed8ae86
@@ -36,6 +36,8 @@ import {
|
||||
IdpSearchRequest,
|
||||
IdpSearchResponse,
|
||||
IdpView,
|
||||
MultiFactor,
|
||||
MultiFactorsResult,
|
||||
OidcIdpConfig,
|
||||
OidcIdpConfigCreate,
|
||||
OidcIdpConfigUpdate,
|
||||
@@ -46,6 +48,8 @@ import {
|
||||
OrgSetUpRequest,
|
||||
OrgSetUpResponse,
|
||||
RemoveIamMemberRequest,
|
||||
SecondFactor,
|
||||
SecondFactorsResult,
|
||||
ViewID,
|
||||
Views,
|
||||
} from '../proto/generated/admin_pb';
|
||||
@@ -73,6 +77,32 @@ export class AdminService {
|
||||
return this.grpcService.admin.setUpOrg(req);
|
||||
}
|
||||
|
||||
public getDefaultLoginPolicyMultiFactors(): Promise<MultiFactorsResult> {
|
||||
const req = new Empty();
|
||||
return this.grpcService.admin.getDefaultLoginPolicyMultiFactors(req);
|
||||
}
|
||||
|
||||
public addMultiFactorToDefaultLoginPolicy(req: MultiFactor): Promise<MultiFactor> {
|
||||
return this.grpcService.admin.addMultiFactorToDefaultLoginPolicy(req);
|
||||
}
|
||||
|
||||
public RemoveMultiFactorFromDefaultLoginPolicy(req: MultiFactor): Promise<Empty> {
|
||||
return this.grpcService.admin.removeMultiFactorFromDefaultLoginPolicy(req);
|
||||
}
|
||||
|
||||
public GetDefaultLoginPolicySecondFactors(): Promise<SecondFactorsResult> {
|
||||
const req = new Empty();
|
||||
return this.grpcService.admin.getDefaultLoginPolicySecondFactors(req);
|
||||
}
|
||||
|
||||
public AddSecondFactorToDefaultLoginPolicy(req: SecondFactor): Promise<SecondFactor> {
|
||||
return this.grpcService.admin.addSecondFactorToDefaultLoginPolicy(req);
|
||||
}
|
||||
|
||||
public RemoveSecondFactorFromDefaultLoginPolicy(req: SecondFactor): Promise<Empty> {
|
||||
return this.grpcService.admin.removeSecondFactorFromDefaultLoginPolicy(req);
|
||||
}
|
||||
|
||||
public GetIamMemberRoles(): Promise<IamMemberRoles> {
|
||||
const req = new Empty();
|
||||
return this.grpcService.admin.getIamMemberRoles(req);
|
||||
|
||||
@@ -5,34 +5,37 @@ import { BehaviorSubject, from, merge, Observable, of, Subject } from 'rxjs';
|
||||
import { catchError, filter, finalize, first, map, mergeMap, switchMap, take, timeout } from 'rxjs/operators';
|
||||
|
||||
import {
|
||||
Changes,
|
||||
ChangesRequest,
|
||||
ExternalIDPRemoveRequest,
|
||||
ExternalIDPSearchRequest,
|
||||
ExternalIDPSearchResponse,
|
||||
Gender,
|
||||
MfaOtpResponse,
|
||||
MultiFactors,
|
||||
MyPermissions,
|
||||
MyProjectOrgSearchQuery,
|
||||
MyProjectOrgSearchRequest,
|
||||
MyProjectOrgSearchResponse,
|
||||
Org,
|
||||
PasswordChange,
|
||||
PasswordComplexityPolicy,
|
||||
UpdateUserAddressRequest,
|
||||
UpdateUserEmailRequest,
|
||||
UpdateUserPhoneRequest,
|
||||
UpdateUserProfileRequest,
|
||||
UserAddress,
|
||||
UserEmail,
|
||||
UserPhone,
|
||||
UserProfile,
|
||||
UserProfileView,
|
||||
UserSessionViews,
|
||||
UserView,
|
||||
VerifyMfaOtp,
|
||||
VerifyUserPhoneRequest,
|
||||
Changes,
|
||||
ChangesRequest,
|
||||
ExternalIDPRemoveRequest,
|
||||
ExternalIDPSearchRequest,
|
||||
ExternalIDPSearchResponse,
|
||||
Gender,
|
||||
MfaOtpResponse,
|
||||
MultiFactors,
|
||||
MyPermissions,
|
||||
MyProjectOrgSearchQuery,
|
||||
MyProjectOrgSearchRequest,
|
||||
MyProjectOrgSearchResponse,
|
||||
Org,
|
||||
PasswordChange,
|
||||
PasswordComplexityPolicy,
|
||||
UpdateUserAddressRequest,
|
||||
UpdateUserEmailRequest,
|
||||
UpdateUserPhoneRequest,
|
||||
UpdateUserProfileRequest,
|
||||
UserAddress,
|
||||
UserEmail,
|
||||
UserPhone,
|
||||
UserProfile,
|
||||
UserProfileView,
|
||||
UserSessionViews,
|
||||
UserView,
|
||||
VerifyMfaOtp,
|
||||
VerifyUserPhoneRequest,
|
||||
VerifyWebAuthN,
|
||||
WebAuthNResponse,
|
||||
WebAuthNTokenID,
|
||||
} from '../proto/generated/auth_pb';
|
||||
import { GrpcService } from './grpc.service';
|
||||
import { StorageKey, StorageService } from './storage.service';
|
||||
@@ -328,9 +331,31 @@ export class GrpcAuthService {
|
||||
);
|
||||
}
|
||||
|
||||
public AddMyMfaU2F(): Promise<WebAuthNResponse> {
|
||||
return this.grpcService.auth.addMyMfaU2F(
|
||||
new Empty(),
|
||||
);
|
||||
}
|
||||
|
||||
public RemoveMyMfaU2F(id: string): Promise<Empty> {
|
||||
const req = new WebAuthNTokenID();
|
||||
req.setId(id);
|
||||
return this.grpcService.auth.removeMyMfaU2F(req);
|
||||
}
|
||||
|
||||
public VerifyMyMfaU2F(credential: string, tokenname: string): Promise<Empty> {
|
||||
const req = new VerifyWebAuthN();
|
||||
req.setPublicKeyCredential(credential);
|
||||
req.setTokenName(tokenname);
|
||||
|
||||
return this.grpcService.auth.verifyMyMfaU2F(
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
public RemoveMfaOTP(): Promise<Empty> {
|
||||
return this.grpcService.auth.removeMfaOTP(
|
||||
new Empty(),
|
||||
new Empty(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user