Ticket was cloned from Red Hat Bugzilla (product Red Hat Enterprise Linux 7): Bug 1458183
Description of problem: When the global default auth-type is set to 'otp', users can still delete their last OTP token. Only after the auth-type has been set explicitly on the user entry, the last token can not be deleted. A user should should not be able to delete the last token for the account when the global auth-type is set to otp. # ipa config-mod --user-auth-type otp # ipa config-show|grep -i auth Default user authentication types: otp - Login as tuser1 $ ipa otptoken-add $ ipa otptoken-find ------------------- 1 OTP token matched ------------------- Unique ID: 448dd2f5-56e3-41dd-bea8-2df72fc3ba96 Type: TOTP Owner: tuser1 ---------------------------- Number of entries returned 1 ---------------------------- $ klist Ticket cache: KEYRING:persistent:88800001:krb_ccache_EgmK3we Default principal: tuser1@GSSLAB.PNQ2.REDHAT.COM Valid starting Expires Service principal 06/02/2017 16:21:05 06/03/2017 16:21:05 krbtgt/GSSLAB.PNQ2.REDHAT.COM@GSSLAB.PNQ2.REDHAT.COM $ ipa otptoken-delete 448dd2f5-56e3-41dd-bea8-2df72fc3ba96 -------------------------------------------------------- Deleted OTP token "448dd2f5-56e3-41dd-bea8-2df72fc3ba96" -------------------------------------------------------- - Change the auth-type on the user entry itself # ipa user-mod tuser1 --user-auth-type otp # ipa user-show tuser1 |grep auth User authentication types: otp - Login as tuser1 again and add a new token and try to delete it $ ipa otptoken-add $ ipa otptoken-find ------------------- 1 OTP token matched ------------------- Unique ID: abb6105d-e751-451f-9f2f-5fed9c436a04 Type: TOTP Owner: tuser1 ---------------------------- Number of entries returned 1 ---------------------------- $ ipa otptoken-del abb6105d-e751-451f-9f2f-5fed9c436a04 ipa: ERROR: Server is unwilling to perform: Can't delete last active token Version-Release number of selected component (if applicable): ipa-server-4.4.0-12.el7.x86_64 How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Metadata Update from @pvoborni: - Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1458183
Metadata Update from @tkrizek: - Issue set to the milestone: FreeIPA 4.6.1 (was: FreeIPA 4.6)
Metadata Update from @tkrizek: - Issue set to the milestone: FreeIPA 4.6.2 (was: FreeIPA 4.6.1)
Metadata Update from @fbarreto: - Issue assigned to fbarreto
Metadata Update from @tdudlak: - Issue set to the milestone: FreeIPA 4.6.3 (was: FreeIPA 4.6.2)
https://github.com/freeipa/freeipa/pull/1416
Metadata Update from @fbarreto: - Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/1416
Metadata Update from @rcritten: - Issue set to the milestone: FreeIPA 4.6.4 (was: FreeIPA 4.6.3)
FreeIPA 4.6.3 has been released, moving to FreeIPA 4.6.4 milestone
Metadata Update from @frenaud: - Issue assigned to frenaud (was: fbarreto)
Metadata Update from @frenaud: - Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/1582 (was: https://github.com/freeipa/freeipa/pull/1416)
master:
ipa-4-6:
Metadata Update from @cheimes: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)