# 2FA just accepts same passkey twice

**URL:** <https://help.nextcloud.com/t/2fa-just-accepts-same-passkey-twice/212371>\
**Category:** ℹ️ Support\
**Tags:** mfa, nc30, twofactor-webauthn-app\
**Created:** [December 10, 2024, 4:19pm UTC](https://help.nextcloud.com/t/2fa-just-accepts-same-passkey-twice/212371 "2024-12-10T16:19:14Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichaelFliegner](https://help.nextcloud.com/user_avatar/help.nextcloud.com/michaelfliegner/32/65398_2.png) [@MichaelFliegner](https://help.nextcloud.com/u/MichaelFliegner)\
**Post date:** [December 10, 2024, 4:19pm UTC](https://help.nextcloud.com/t/2fa-just-accepts-same-passkey-twice/212371/1 "2024-12-10T16:19:14Z")

</div>

> **Support intro**
>
> ## Sorry to hear you’re facing problems. 🙁
> 
> _The community help forum ([help.nextcloud.com](http://help.nextcloud.com)) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are **volunteering their time to help you.** _
> 
> **If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via [portal.nextcloud.com](http://portal.nextcloud.com) where Nextcloud engineers can help ensure your business keeps running smoothly.**
> 
> ## Getting help
> 
> In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.
> 
> **Before clicking submit** : Please check if your query is already addressed via the following resources:
> 
> - [Official documentation](https://docs.nextcloud.com) (searchable and regularly updated)
> - [How to topics and FAQs](https://help.nextcloud.com/c/how-to-faqs/9)
> - [Forum search](https://help.nextcloud.com/search)
> 
> (Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. ❤

## The Basics

- Nextcloud Server version _(e.g., 29.x.x)_:
  - `30.0.2`

- Operating system and version _(e.g., Ubuntu 24.04)_:
  - `Ubuntu 24.04`

- Web server and version _(e.g, Apache 2.4.25)_:
  - `replace me`

- Reverse proxy and version \_(e.g. nginx 1.27.2)
  - `replace me`

- PHP version _(e.g, 8.3)_:
  - `replace me`

- Is this the first time you’ve seen this error? (Yes / No):
  - `replace me`

- When did this problem seem to first start?
  - `replace me`

- Installation method _(e.g. AIO, NCP, Bare Metal/Archive, etc.)_
  - `AIO 10.0.0 `

- Are you using Cloudflare, mod\_security, or similar? _(Yes / No)_
  - `replace me`

### Summary of the issue you are facing:

[…]

### Steps to replicate it (hint: details matter!):

1. Use 2FA and Webauthn phone has passkey
2. Login and choose login with device
3. After passkey was entered on phone, nextcloud asks for 2nd factor and … accepts passkey from phone again.

### Log entries

#### Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the _Copy raw_ option from _Administration settings-\>Logging_ screen or from your `nextcloud.log` located in your data directory). Feel free to use a pastebin/gist service if necessary.

```auto
PASTE HERE

```

#### Web Browser

If the problem is related to the Web interface, open your browser inspector _Console_ and _Network_ tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

```auto
PASTE

```

#### Web server / Reverse Proxy

The output of your Apache/nginx/system log in `/var/log/ ____ `:

```auto
PASTE HERE

```

### Configuration

#### Nextcloud

The output of `occ config:list system` or similar is best, but, if not possible, the contents of your `config.php` file from `/path/to/nextcloud` is fine (make sure to remove any identifiable information!):

```auto
PASTE HERE

```

#### Apps

The output of `occ app:list` (if possible).

### Tips for increasing the likelihood of a response

- Use the `preformatted text` formatting option in the editor for all log entries and configuration output.
- If screenshots are useful, feel free to include them.
  - If possible, also include key error output in text form so it can be searched for.

- Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

---

<div class="post-metadata">

**Author:** ![rakekniven](https://help.nextcloud.com/user_avatar/help.nextcloud.com/rakekniven/32/67096_2.png) [@rakekniven](https://help.nextcloud.com/u/rakekniven)\
**Post date:** [December 10, 2024, 8:05pm UTC](https://help.nextcloud.com/t/2fa-just-accepts-same-passkey-twice/212371/2 "2024-12-10T20:05:25Z")

</div>

Sure you are talking about Passkeys?

---

<div class="post-metadata">

**Author:** ![MichaelFliegner](https://help.nextcloud.com/user_avatar/help.nextcloud.com/michaelfliegner/32/65398_2.png) [@MichaelFliegner](https://help.nextcloud.com/u/MichaelFliegner)\
**Post date:** [December 10, 2024, 8:52pm UTC](https://help.nextcloud.com/t/2fa-just-accepts-same-passkey-twice/212371/3 "2024-12-10T20:52:18Z")

</div>

You being funny?  
My fingerprint on my phone is a passkey registered in my google account for my nextcloud account.  
That’s as valid a U2F passkey as Your Yubikey??? or whatsoever  
would be. (less secure, admittedly)  
What do You think a passkey would be?

And nc authentication accepts

1. my fingerprint after I chose login with a device and
2. thereafter it tells me that 2FA is on, but accepts _ **the same passkey** _ as a second factor.

But presenting one thingy twice does not make it two, does it? That’s still 1FA.

---

<div class="post-metadata">

**Author:** ![rakekniven](https://help.nextcloud.com/user_avatar/help.nextcloud.com/rakekniven/32/67096_2.png) [@rakekniven](https://help.nextcloud.com/u/rakekniven)\
**Post date:** [December 10, 2024, 9:13pm UTC](https://help.nextcloud.com/t/2fa-just-accepts-same-passkey-twice/212371/4 "2024-12-10T21:13:15Z")

</div>

> [@MichaelFliegner](#):
>
> You being funny?

No.

A passkey is no 2FA. It should be a replacement for a password AND 2FA e. g. sms code.

A fingerprint is not a passkey. It just unlocks your phone and passkey can be read from Secure Enclave of your device.

heise has some really good articles about passkeys as Amazon, eBay or others offering right now.

---

<div class="post-metadata">

**Author:** ![MichaelFliegner](https://help.nextcloud.com/user_avatar/help.nextcloud.com/michaelfliegner/32/65398_2.png) [@MichaelFliegner](https://help.nextcloud.com/u/MichaelFliegner)\
**Post date:** [December 10, 2024, 9:25pm UTC](https://help.nextcloud.com/t/2fa-just-accepts-same-passkey-twice/212371/5 "2024-12-10T21:25:51Z")

</div>

![Screenshot_20241210-221903](https://help.nextcloud.com/uploads/default/original/3X/1/8/187fe3f76d9834c7fe9b58727b1bcea5d1ba82a3.png)

So we tell Google thei’re wrong?

_ **Right, I used sloppy language.** _

My fingerprint is _ **technically** _ not a passkey, that’s a private key it has for this account. But my fingerprint unlocks its application to the public key key presented by the server.

---

<div class="post-metadata">

**Author:** ![rakekniven](https://help.nextcloud.com/user_avatar/help.nextcloud.com/rakekniven/32/67096_2.png) [@rakekniven](https://help.nextcloud.com/u/rakekniven)\
**Post date:** [December 10, 2024, 9:31pm UTC](https://help.nextcloud.com/t/2fa-just-accepts-same-passkey-twice/212371/6 "2024-12-10T21:31:57Z")

</div>

No, please re-read the text. You unlock your device to enable your device using stored passkeys. It could be the fingerprint or pattern to unlock.

---

<div class="post-metadata">

**Author:** ![MichaelFliegner](https://help.nextcloud.com/user_avatar/help.nextcloud.com/michaelfliegner/32/65398_2.png) [@MichaelFliegner](https://help.nextcloud.com/u/MichaelFliegner)\
**Post date:** [December 10, 2024, 9:45pm UTC](https://help.nextcloud.com/t/2fa-just-accepts-same-passkey-twice/212371/7 "2024-12-10T21:45:42Z")

</div>

> [@rakekniven](#):
>
> You unlock your device to enable your device using stored passkeys. It could be the fingerprint or pattern to unlock.

That’s what I wrote.

> [@rakekniven](#):
>
> A passkey is no 2FA. It should be a replacement for a password AND 2FA e. g. sms code.

And should I reread nextcloud docs on 2FA as well?

> [@https://docs.nextcloud.com/server/latest/user\_manual/en/user\_2fa.html](#):
>
> Two-factor authentication (2FA) is a way to protect your Nextcloud account against unauthorized access. It works by _ **requiring two different ‘proofs’ of your identity.** _ For example, _something you know_ (like a password) and _something you have_ like a physical key. Typically, the first factor is a password like you already have and the second can be a text message you receive _or a code you generate on your phone_ or another device (_something you have_ ). Nextcloud supports a variety of 2nd factors and more can be added.

So a passkey on my phone - use of which I can authorize with my fingerprint - can be a part of my 2 factor authentication

And my original complaint prevails: If You configure WebAuthn and 2FA, nextcloud doesn’t ensure that there are _ **two different proofs** _ of identity.

---

<div class="post-metadata">

**Author:** ![bb77](https://help.nextcloud.com/letter_avatar/bb77/32/6_449c533f586939b6e5f246632a46421f.png) [@bb77](https://help.nextcloud.com/u/bb77)\
**Post date:** [December 11, 2024, 6:59am UTC](https://help.nextcloud.com/t/2fa-just-accepts-same-passkey-twice/212371/8 "2024-12-11T06:59:53Z")

</div>

> [@MichaelFliegner](#):
>
> If You configure WebAuthn and 2FA, nextcloud doesn’t ensure that there are _ **two different proofs** _ of identity.

Hmm, not sure if that would even be possible.

I mean, the built-in passwordless login feature and the 2FA WebAuthn app are two separate apps, so that alone probably prevents them from knowing if the other one is using the same passkey provider or not, _if_ there’s any way for the apps to distinguish between passkey providers in the first place, which I also doubt there is.

So I’d say that if you absolutely want to add 2FA with another passkey, even though passkeys are supposed to be a replacement for passwords _and_ 2FA, I’d say it’s up to you to make sure that “two different proofs of your identity” are used, like for example, a passkey provided by the Google password manager for passwordless login and a hardware key for 2FA.

---

<div class="post-metadata">

**Author:** ![MichaelFliegner](https://help.nextcloud.com/user_avatar/help.nextcloud.com/michaelfliegner/32/65398_2.png) [@MichaelFliegner](https://help.nextcloud.com/u/MichaelFliegner)\
**Post date:** [December 11, 2024, 8:11am UTC](https://help.nextcloud.com/t/2fa-just-accepts-same-passkey-twice/212371/9 "2024-12-11T08:11:44Z")

</div>

I see that it cannot work with 2 different apps.  
It’s not that I absolutely want 2FA together with a passkey, it is NC docs cited above and the NC security settings page that imply this possibility - and a short recherche could show You more opinions, where passkeys are not viewed as mutually exclusive to MFA.

Nextcloud security settings should offer **either passwordless authentication or 2FA** - including security keys.  
Backup codes should be offered independently, because they are a **replacement** of other authentication methods, not an additional factor.

 ![Screenshot_20241211-084720](https://help.nextcloud.com/uploads/default/original/3X/5/e/5ead00f9a0b22bf7c1585b060d2ed3a81e66d706.png)

---

<div class="post-metadata">

**Author:** ![bb77](https://help.nextcloud.com/letter_avatar/bb77/32/6_449c533f586939b6e5f246632a46421f.png) [@bb77](https://help.nextcloud.com/u/bb77)\
**Post date:** [December 11, 2024, 9:07am UTC](https://help.nextcloud.com/t/2fa-just-accepts-same-passkey-twice/212371/10 "2024-12-11T09:07:32Z")

</div>

> [@MichaelFliegner](#):
>
> Nextcloud security settings should offer **either passwordless authentication or 2FA** - including security keys.

I’d say no, because why restrict users to add it if they absolutely want to.

However, I think it should be possible to disable authentication with username/password when passwordless login is enabled, in which case it would also make sense to offer backup codes for the passwordless login.

---

<div class="post-metadata">

**Author:** ![MichaelFliegner](https://help.nextcloud.com/user_avatar/help.nextcloud.com/michaelfliegner/32/65398_2.png) [@MichaelFliegner](https://help.nextcloud.com/u/MichaelFliegner)\
**Post date:** [December 11, 2024, 9:11am UTC](https://help.nextcloud.com/t/2fa-just-accepts-same-passkey-twice/212371/11 "2024-12-11T09:11:37Z")

</div>

then what does the word passwordless mean???

Having both on is not liberal, but confusing in my not so humble 🤭opinion.

> <https://github.com/nextcloud/server/issues/49796>
>
> Having both on is contradictory and may lead to login accepting the same passkey… twice, which is not risky, but confusing.
> Moreover should backup codes not be offered as an additional factor, but as an authentication method on its own, because it can replace other methods.

---

<div class="post-metadata">

**Author:** ![bb77](https://help.nextcloud.com/letter_avatar/bb77/32/6_449c533f586939b6e5f246632a46421f.png) [@bb77](https://help.nextcloud.com/u/bb77)\
**Post date:** [December 11, 2024, 10:01am UTC](https://help.nextcloud.com/t/2fa-just-accepts-same-passkey-twice/212371/12 "2024-12-11T10:01:18Z")

</div>

There are two primary methods to log in to Nextcloud:

### Passwordless Login:

This method uses WebAuthn, FIDO2, or Passkeys. These terms essentially refer to the same technology but with slight differences in context or branding.

WebAuthn/FIDO2 has been around for a few years, providing login options mainly through hardware tokens (e.g., YubiKeys) or biometric devices. Passkeys, expand this capability by enabling software-based password managers or device synchronization (e.g., iCloud Keychain or Google Password Manager) to act as your “hardware token.”

### Traditional Login:

The traditional username and password combination.

This method remains still active when you enable Passwordless Login, and therfore ensures that if you lose access to your passkey or hardware token, you can still log in using your credentials.

### 2FA

2FA is an additional thing, and can be set up regardless of the login method (passwordless or traditional username/password).

Supported 2FA methods in Nextcloud include:

- TOTP (e.g., Google Authenticator or Authy),
- Email-based codes,
- SMS-based codes,
- WebAuthn/FIDO2/Passkeys (reused as a second authentication factor).
- and probably many more

Once 2FA is enabled, having backup codes is crucial, as there is no ‘password reset’ function with 2FA. If you lose access to your passkey, TOTP secret or any other 2FA method, you won’t be able to log in unless you have multiple 2FA methods enabled as a fallback, just as the traditional login option can be used as a fallback if you lose the passkey for passwordless login.

Of course, the overall security of your system is only as strong as the weakest login or 2FA method you’ve enabled.

For example, if you enable passwordless login, but still allow username and password without strong 2FA, the traditional method could still become a vulnerability, so I think it should be possible to disable traditional login when using passwordless login, which would then allow you to disable 2FA for that account as well.

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [December 19, 2024, 10:01am UTC](https://help.nextcloud.com/t/2fa-just-accepts-same-passkey-twice/212371/13 "2024-12-19T10:01:57Z")

</div>

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.
