xoauth icon indicating copy to clipboard operation
xoauth copied to clipboard

Deleting client gives: panic: secret not found in keyring

Open berenddeboer opened this issue 5 years ago • 2 comments

When I try to delete a client I get:

./xoauth delete dummy
? Are you sure you want to delete this connection? Yes
panic: secret not found in keyring

goroutine 1 [running]:
github.com/XeroAPI/xoauth/pkg/config.ConfirmDelete(0xc0000cb100, 0x7fffaed9815d, 0x5)
        /home/runner/work/xoauth/xoauth/pkg/config/delete.go:30 +0x286
github.com/XeroAPI/xoauth/cmd.init.0.func6(0xc0000f1340, 0xc0000cb0a0, 0x1, 0x1)
        /home/runner/work/xoauth/xoauth/cmd/root.go:127 +0x52
github.com/spf13/cobra.(*Command).execute(0xc0000f1340, 0xc0000cb080, 0x1, 0x1, 0xc0000f1340, 0xc0000cb080)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:846 +0x2aa
github.com/spf13/cobra.(*Command).ExecuteC(0xd1f720, 0x0, 0x8815a0, 0xc000098058)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:950 +0x349
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:887
github.com/XeroAPI/xoauth/cmd.Execute(...)
        /home/runner/work/xoauth/xoauth/cmd/root.go:254
main.main()
        /home/runner/work/xoauth/xoauth/xoauth.go:13 +0x47

berenddeboer avatar Apr 01 '21 01:04 berenddeboer

Same issue here. Is there any solution to this?

nikhilfsoft avatar Apr 07 '21 01:04 nikhilfsoft

This happened for me with a PKCE client as the code tries to delete a client secret that's not there (PKCE clients don't need one). If that's your use-case and you can't wait for the fix you can workaround it in the short-term by very carefully (backup first!):

  • Opening ~/.xoauth/xoauth.json and removing the client by hand from the JSON
  • Deleting all relevant entries from your system keyring

I've submitted a PR to fix it.

Ian2020 avatar May 26 '21 10:05 Ian2020