# Disable certain 2FA provider via occ

**URL:** <https://help.nextcloud.com/t/disable-certain-2fa-provider-via-occ/72094>\
**Category:** ℹ️ Support\
**Tags:** mfa\
**Created:** [February 25, 2020, 1:34am UTC](https://help.nextcloud.com/t/disable-certain-2fa-provider-via-occ/72094 "2020-02-25T01:34:31Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![PopeRigby](https://help.nextcloud.com/user_avatar/help.nextcloud.com/poperigby/32/29172_2.png) [@PopeRigby](https://help.nextcloud.com/u/PopeRigby)\
**Post date:** [February 25, 2020, 1:34am UTC](https://help.nextcloud.com/t/disable-certain-2fa-provider-via-occ/72094/1 "2020-02-25T01:34:31Z")

</div>

I’m trying to disable [Two-Factor Authentication via Nextcloud notification](https://apps.nextcloud.com/apps/twofactor_nextcloud_notification) via occ, because I keep getting this annoying (but non-breaking) error when I’m logging in  
 ![Screenshot_2020-02-24%20Haddock%20Cloud](https://help.nextcloud.com/uploads/default/original/3X/5/7/57736a22c2daa93ceead29f4e23b138f86281f4a.jpeg)

So I went into my logs and found this error that kept popping up:

```auto
two-factor auth provider 'twofactor_nextcloud_notification' failed to load

```

So, I tried running this command to disable `twofactor_nextcloud_notification`:

```auto
./occ twofactorauth:disable username twofactor_nextcloud_notification

```

but it’s giving me this error

```auto
In ProviderManager.php line 54:
The provider 'twofactor_nextcloud_notification' does not exist'

```

So how do I go about disabling `twofactor_nextcloud_notification`?

---

<div class="post-metadata">

**Author:** ![j-ed](https://help.nextcloud.com/user_avatar/help.nextcloud.com/j-ed/32/7281_2.png) [@j-ed](https://help.nextcloud.com/u/j-ed)\
**Post date:** [February 25, 2020, 9:12am UTC](https://help.nextcloud.com/t/disable-certain-2fa-provider-via-occ/72094/2 "2020-02-25T09:12:34Z")

</div>

Disable the app the right way:

```auto
./occ app:disable <app-name>

```

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/6_22734026db12803ebb3e059622ac3534.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [February 25, 2020, 11:29am UTC](https://help.nextcloud.com/t/disable-certain-2fa-provider-via-occ/72094/3 "2020-02-25T11:29:54Z")

</div>

You can get the state for a user:  
`php occ twofactorauth:state user`

And you get the right provider names. I’m not sure if you can disable all providers if you enforce the use of 2FA.

---

<div class="post-metadata">

**Author:** ![PopeRigby](https://help.nextcloud.com/user_avatar/help.nextcloud.com/poperigby/32/29172_2.png) [@PopeRigby](https://help.nextcloud.com/u/PopeRigby)\
**Post date:** [February 25, 2020, 3:13pm UTC](https://help.nextcloud.com/t/disable-certain-2fa-provider-via-occ/72094/4 "2020-02-25T15:13:06Z")

</div>

I forgot to mention how that was how I originally got the `twofactor_nextcloud_notfication` name. When I do `./occ twofactorauth:state user`, I get

```auto
Enabled providers:
- backup_codes
- totp
- twofactor_nextcloud_notification

```

---

<div class="post-metadata">

**Author:** ![PopeRigby](https://help.nextcloud.com/user_avatar/help.nextcloud.com/poperigby/32/29172_2.png) [@PopeRigby](https://help.nextcloud.com/u/PopeRigby)\
**Post date:** [February 25, 2020, 3:15pm UTC](https://help.nextcloud.com/t/disable-certain-2fa-provider-via-occ/72094/5 "2020-02-25T15:15:22Z")

</div>

That won’t work because [Two-Factor Authentication via Nextcloud notification](https://apps.nextcloud.com/apps/twofactor_nextcloud_notification) isn’t actually installed. It’s just still associated with my account, even after I disabled and removed it.

---

<div class="post-metadata">

**Author:** ![CFelix](https://help.nextcloud.com/letter_avatar/cfelix/32/6_22734026db12803ebb3e059622ac3534.png) [@CFelix](https://help.nextcloud.com/u/CFelix)\
**Post date:** [February 25, 2020, 3:35pm UTC](https://help.nextcloud.com/t/disable-certain-2fa-provider-via-occ/72094/6 "2020-02-25T15:35:20Z")

</div>

Now that you know what providers are enabled for the given user, you can run the command `./occ twofactor:disable <userid> <provider_id>` to disable the provider for that user.

I.E. `./occ twofactor:disable user twofactor_nextcloud_notification`

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/6_22734026db12803ebb3e059622ac3534.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [February 25, 2020, 4:45pm UTC](https://help.nextcloud.com/t/disable-certain-2fa-provider-via-occ/72094/7 "2020-02-25T16:45:50Z")

</div>

Well that is what he did, check the first post. Then it’s a bug?

---

<div class="post-metadata">

**Author:** ![CFelix](https://help.nextcloud.com/letter_avatar/cfelix/32/6_22734026db12803ebb3e059622ac3534.png) [@CFelix](https://help.nextcloud.com/u/CFelix)\
**Post date:** [February 25, 2020, 5:00pm UTC](https://help.nextcloud.com/t/disable-certain-2fa-provider-via-occ/72094/8 "2020-02-25T17:00:15Z")

</div>

His syntax looks different though, unless both can be used 🤔

EDIT:

Other than that, I agree, it looks like a bug from that app (just like most apps) - They never clean up after themselves when you uninstall them.

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/6_22734026db12803ebb3e059622ac3534.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [February 25, 2020, 7:27pm UTC](https://help.nextcloud.com/t/disable-certain-2fa-provider-via-occ/72094/9 "2020-02-25T19:27:21Z")

</div>

I found something in the bug tracker, so it seems that you need to enable this authentication provider, or you cleanup:

`... twofactorauth:cleanup <providerId>`

> <https://github.com/nextcloud/server/issues/18828>
>
> One user used twofactor\_nextcloud\_notification.
> I disabled it (security thinking) and now user cant login because twofactor\_nextcloud\_notification is enabled for account. I tried...

---

<div class="post-metadata">

**Author:** ![PopeRigby](https://help.nextcloud.com/user_avatar/help.nextcloud.com/poperigby/32/29172_2.png) [@PopeRigby](https://help.nextcloud.com/u/PopeRigby)\
**Post date:** [February 25, 2020, 11:59pm UTC](https://help.nextcloud.com/t/disable-certain-2fa-provider-via-occ/72094/10 "2020-02-25T23:59:35Z")

</div>

That seems to have fixed it. Thanks! 😀

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 11, 2024, 8:51pm UTC](https://help.nextcloud.com/t/disable-certain-2fa-provider-via-occ/72094/11 "2024-12-11T20:51:06Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 11, 2024, 8:51pm UTC](https://help.nextcloud.com/t/disable-certain-2fa-provider-via-occ/72094/12 "2024-12-11T20:51:07Z")

</div>


