diff --git a/lib/auth/auth_with_roles.go b/lib/auth/auth_with_roles.go index 931dd4178a1e1..2d93d3ce476ba 100644 --- a/lib/auth/auth_with_roles.go +++ b/lib/auth/auth_with_roles.go @@ -3645,7 +3645,8 @@ func (a *ServerWithRoles) CreateSAMLConnector(ctx context.Context, connector typ return nil, trace.Wrap(err) } - if err := a.context.AuthorizeAdminAction(); err != nil { + // Support reused MFA for bulk tctl create requests. + if err := a.context.AuthorizeAdminActionAllowReusedMFA(); err != nil { return nil, trace.Wrap(err) } @@ -3663,7 +3664,8 @@ func (a *ServerWithRoles) UpdateSAMLConnector(ctx context.Context, connector typ return nil, trace.Wrap(err) } - if err := a.context.AuthorizeAdminAction(); err != nil { + // Support reused MFA for bulk tctl create requests. + if err := a.context.AuthorizeAdminActionAllowReusedMFA(); err != nil { return nil, trace.Wrap(err) } diff --git a/lib/auth/integration/integrationv1/service.go b/lib/auth/integration/integrationv1/service.go index 68831213c0fd5..f5339d7c913f1 100644 --- a/lib/auth/integration/integrationv1/service.go +++ b/lib/auth/integration/integrationv1/service.go @@ -198,6 +198,10 @@ func (s *Service) CreateIntegration(ctx context.Context, req *integrationpb.Crea return nil, trace.Wrap(err) } + if err := authCtx.AuthorizeAdminActionAllowReusedMFA(); err != nil { + return nil, trace.Wrap(err) + } + if err := authCtx.CheckAccessToKind(types.KindIntegration, types.VerbCreate); err != nil { return nil, trace.Wrap(err) } @@ -243,6 +247,10 @@ func (s *Service) UpdateIntegration(ctx context.Context, req *integrationpb.Upda return nil, trace.Wrap(err) } + if err := authCtx.AuthorizeAdminActionAllowReusedMFA(); err != nil { + return nil, trace.Wrap(err) + } + if err := authCtx.CheckAccessToKind(types.KindIntegration, types.VerbUpdate); err != nil { return nil, trace.Wrap(err) }