X-Git-Url: https://git.proxmox.com/?p=pve-access-control.git;a=blobdiff_plain;f=PVE%2FAPI2%2FDomains.pm;h=dac56608da05aec8e639187514433308d6b2e63f;hp=10515c0da9f3cc43e9d8b46b6ef217466eedcd5b;hb=96f8ebd62506bc7126d58400004101ef6a13ca71;hpb=ab652a80189a1498caba8c7f3f2641affe9ec3bf diff --git a/PVE/API2/Domains.pm b/PVE/API2/Domains.pm index 10515c0..dac5660 100644 --- a/PVE/API2/Domains.pm +++ b/PVE/API2/Domains.pm @@ -34,6 +34,13 @@ __PACKAGE__->register_method ({ type => "object", properties => { realm => { type => 'string' }, + tfa => { + description => "Two-factor authentication provider.", + type => 'string', + enum => [ 'yubico' ], + optional => 1, + }, + comment => { type => 'string', optional => 1 }, comment => { type => 'string', optional => 1 }, }, }, @@ -52,6 +59,9 @@ __PACKAGE__->register_method ({ my $entry = { realm => $realm, type => $d->{type} }; $entry->{comment} = $d->{comment} if $d->{comment}; $entry->{default} = 1 if $d->{default}; + if ($d->{tfa} && (my $tfa_cfg = PVE::Auth::Plugin::parse_tfa_config($d->{tfa}))) { + $entry->{tfa} = $tfa_cfg->{type}; + } push @$res, $entry; }