# Unable to list credentials and set FIDO2 PIN in CLI

**URL:** <https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279>\
**Category:** Two Factor Authentication\
**Created:** [March 15, 2021, 6:00pm UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279 "2021-03-15T18:00:41Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZorgroZ](https://avatars.discourse-cdn.com/v4/letter/z/96bed5/32.png) [@ZorgroZ](https://onlykey.discourse.group/u/ZorgroZ)\
**Post date:** [March 15, 2021, 6:00pm UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279/1 "2021-03-15T18:00:41Z")

</div>

My OnlyKey is in config mode (the LED is flashing red). I am starting the Python CLI:

First I want to set the FIDO2 PIN:

```
OnlyKey> set-pin

Please enter new pin:
Please confirm new pin:
no device found

```

What does the “no device found” mean here?

Next, I want to show / list FIDO2 credentials:

```
OnlyKey> credential info

PIN:

OnlyKey>

```

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![ZorgroZ](https://avatars.discourse-cdn.com/v4/letter/z/96bed5/32.png) [@ZorgroZ](https://onlykey.discourse.group/u/ZorgroZ)\
**Post date:** [March 20, 2021, 11:42am UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279/2 "2021-03-20T11:42:02Z")

</div>

Still haven’t made any progress unfortunately.

I have verified with the demo at [https://webauthn.io](https://webauthn.io) that authentication works, but I am unable to use any of the functions in the Python CLI related to FIDO2 (`set-pin`, `change-pin`, `credential info`, `credential ls`), see above.

Any pointers are welcome.

---

<div class="post-metadata">

**Author:** ![designexpertsllc](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@designexpertsllc](https://onlykey.discourse.group/u/designexpertsllc)\
**Post date:** [March 29, 2021, 3:36am UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279/3 "2021-03-29T03:36:34Z")

</div>

Same issue here. Not sure what is going on. I have setup a few things with FIDO2 and it doesn’t show anything.

I believe you wont be able to set the pin once it is configured initially though.

---

<div class="post-metadata">

**Author:** ![ZorgroZ](https://avatars.discourse-cdn.com/v4/letter/z/96bed5/32.png) [@ZorgroZ](https://onlykey.discourse.group/u/ZorgroZ)\
**Post date:** [March 30, 2021, 7:20pm UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279/4 "2021-03-30T19:20:33Z")

</div>

> [@designexpertsllc](#):
>
> Same issue here. Not sure what is going on. I have setup a few things with FIDO2 and it doesn’t show anything.

Thanks for confirming – I was wondering whether it’s just me.

> [@designexpertsllc](#):
>
> I believe you wont be able to set the pin once it is configured initially though.

How do you set the PIN during initial configuration? To my understanding, the FIDO2 PIN is unrelated to the PINs which are set up during initial configuration (i.e., primary and secondary profiles, and wiping). I can recall that there was an option to set up a FIDO2 PIN, and if it’s not possible to change it later, then I’d be wondering why there is an API for it through the Python CLI.

Hopefully we’ll receive a response from the developers to clarify this.

---

<div class="post-metadata">

**Author:** ![designexpertsllc](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@designexpertsllc](https://onlykey.discourse.group/u/designexpertsllc)\
**Post date:** [March 30, 2021, 7:40pm UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279/5 "2021-03-30T19:40:09Z")

</div>

yeah you are probably on to something there. I assumed it was requesting the initial lock code from when it was setup.

---

<div class="post-metadata">

**Author:** ![t11](https://avatars.discourse-cdn.com/v4/letter/t/8e7dd6/32.png) [@t11](https://onlykey.discourse.group/u/t11)\
**Post date:** [March 31, 2021, 6:10pm UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279/6 "2021-03-31T18:10:55Z")

</div>

@ZorgroZ There are several ways to set the PIN.

1. This is set whenever you register your key at a site supporting FIDO2 for example - passwordless.dev
2. This is set in Windows 10 by going to manage your security keys
3. This is set manually with the OnlyKey CLI like this:

```auto
$ onlykey-cli set-pin
Please enter new pin: 
Please confirm new pin: 
Done. Please use new pin to verify key

```

Note: This pin is entered via your keyboard not on the OnlyKey, FIDO2 requires this.

Edit: Just saw that you said your device was in config mode. This is not required to set the FIDO2 pin, just set this pin with OnlyKey unlocked via keyboard.

---

<div class="post-metadata">

**Author:** ![designexpertsllc](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@designexpertsllc](https://onlykey.discourse.group/u/designexpertsllc)\
**Post date:** [March 31, 2021, 6:24pm UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279/7 "2021-03-31T18:24:28Z")

</div>

Mine was not in config mode and gets the same no device found error

---

<div class="post-metadata">

**Author:** ![t11](https://avatars.discourse-cdn.com/v4/letter/t/8e7dd6/32.png) [@t11](https://onlykey.discourse.group/u/t11)\
**Post date:** [March 31, 2021, 8:53pm UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279/8 "2021-03-31T20:53:06Z")

</div>

If using Linux you have the UDEV rule installed? Can you provide OS you are using and other details that would help reproduce issue?

---

<div class="post-metadata">

**Author:** ![designexpertsllc](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@designexpertsllc](https://onlykey.discourse.group/u/designexpertsllc)\
**Post date:** [March 31, 2021, 9:05pm UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279/9 "2021-03-31T21:05:51Z")

</div>

I have tried both. Windows 10 gets “no device found” and Linux got a different error. I can try Linux again and update here.

---

<div class="post-metadata">

**Author:** ![t11](https://avatars.discourse-cdn.com/v4/letter/t/8e7dd6/32.png) [@t11](https://onlykey.discourse.group/u/t11)\
**Post date:** [March 31, 2021, 9:06pm UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279/10 "2021-03-31T21:06:44Z")

</div>

Tested on Ubuntu 20.10 VM downloaded from [osboxes.org](http://osboxes.org), followed instructions here -[OnlyKey Command-Line Utility | Docs](https://docs.crp.to/command-line.html)

 ![image](https://global.discourse-cdn.com/free1/uploads/onlykey/original/1X/2b4ee109172525f96be6bfd1e1dfa754b4cc4c42.jpeg)

set-pin works as expected

---

<div class="post-metadata">

**Author:** ![ZorgroZ](https://avatars.discourse-cdn.com/v4/letter/z/96bed5/32.png) [@ZorgroZ](https://onlykey.discourse.group/u/ZorgroZ)\
**Post date:** [March 31, 2021, 9:15pm UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279/11 "2021-03-31T21:15:19Z")

</div>

I am also still getting “no device found” on Windows 10, whether in config mode or not (key unlocked obviously, i.e., LED green) when using the Python CLI. I also verified that the FIDO2 PIN is indeed not set / changed, so it’s effectively not working for me.

I was only able to set the FIDO2 PIN through Windows 10 settings (“Sign-in options”) as suggested by your item 2 above and in the [other thread](https://onlykey.discourse.group/t/a-few-questions-need-answering-please/315/16).

BTW, why are there two similar functions: `set-pin` and `change-pin`? (`change-pin` also doesn’t work for me, with similar output than `set-pin`.)

@t11 Are you able to also verify `set-pin` / `change-pin` functionality on Windows 10? Is there any info I can provide to diagnose / reproduce this?

---

<div class="post-metadata">

**Author:** ![Extrawdw](https://yyz2.discourse-cdn.com/free1/user_avatar/onlykey.discourse.group/extrawdw/32/60_2.png) [@Extrawdw](https://onlykey.discourse.group/u/Extrawdw)\
**Post date:** [April 2, 2021, 12:23pm UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279/12 "2021-04-02T12:23:31Z")

</div>

On Windows 10, apps need elevated rights to access FIDO2 devices, just run command prompt or powershell as admin. You can also set, change PIN in Windows 10 Settings App without elevated rights.

Browsers use WinCrypt API so they don’t need elevated rights.

---

<div class="post-metadata">

**Author:** ![pepe](https://yyz2.discourse-cdn.com/free1/user_avatar/onlykey.discourse.group/pepe/32/106_2.png) [@pepe](https://onlykey.discourse.group/u/pepe)\
**Post date:** [April 2, 2021, 12:24pm UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279/13 "2021-04-02T12:24:26Z")

</div>

Edit: @Extrawdw beat me to it:

> [@Extrawdw](#):
>
> On Windows, apps need elevated rights to access FIDO2 devices, just run command prompt or powershell as admin.

I think I found the solution for Windows 10. I feel dumb for not thinking of it sooner. Run as Admin. That’s all. See the screenshots below, I run `net file` to show which shell is running with admin permissions.

Regular user:  
 ![image](https://global.discourse-cdn.com/free1/uploads/onlykey/original/1X/1b0732ef0619be776870e8ed17eb2fd8b9667192.png)

Administrator:  
 ![image](https://global.discourse-cdn.com/free1/uploads/onlykey/original/1X/ca0a3b67a5ae23ca4ad2047b3c4d502a8a56efb7.png)

Please don’t tell my boss that it took me this long to figure it out 😅

---

<div class="post-metadata">

**Author:** ![ZorgroZ](https://avatars.discourse-cdn.com/v4/letter/z/96bed5/32.png) [@ZorgroZ](https://onlykey.discourse.group/u/ZorgroZ)\
**Post date:** [April 2, 2021, 8:45pm UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279/14 "2021-04-02T20:45:28Z")

</div>

> [@Extrawdw](#):
>
> On Windows 10, apps need elevated rights to access FIDO2 devices, just run command prompt or powershell as admin. You can also set, change PIN in Windows 10 Settings App without elevated rights.
> 
> Browsers use WinCrypt API so they don’t need elevated rights.

Thanks @Extrawdw, this also works for me. For someone not intimately familiar with FIDO functionality on Windows 10, it’s really not obvious that admin rights are needed for just these few CLI commands (and not the others). It’s also not obvious that you don’t have to be in command mode for this. I suggest both should be mentioned in the documentation.

---

<div class="post-metadata">

**Author:** ![designexpertsllc](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@designexpertsllc](https://onlykey.discourse.group/u/designexpertsllc)\
**Post date:** [April 21, 2021, 3:58am UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279/15 "2021-04-21T03:58:49Z")

</div>

I know I tried Admin command prompt but i must have missed something along the way at the time. Thanks for the help. works now.

---

<div class="post-metadata">

**Author:** ![t11](https://avatars.discourse-cdn.com/v4/letter/t/8e7dd6/32.png) [@t11](https://onlykey.discourse.group/u/t11)\
**Post date:** [June 7, 2021, 12:01pm UTC](https://onlykey.discourse.group/t/unable-to-list-credentials-and-set-fido2-pin-in-cli/279/16 "2021-06-07T12:01:48Z")

</div>

The newly released CLI here no longer requires running as admin to list credentials - [Release v1.2.5 · trustcrypto/python-onlykey · GitHub](https://github.com/trustcrypto/python-onlykey/releases/tag/v1.2.5)
