wandera / 1password-client

Python wrapper for OnePassword CLI developed at Wandera.
MIT License
47 stars 25 forks source link

How to fix "first signin failed" #11

Closed motley74 closed 3 years ago

motley74 commented 3 years ago

Hello,

I just started using this module and I messed up on the first attempt and did not complete the first signin. Now when I try to use this I get the error "First signin failed or not executed." and would like to know if there is a way to fix that. I am able to use the 1password app on my Mac and can also successfully use 'op' cli commands outside of using this module so I can verify that the app is working. I think I need a way to "clean" the data used by the module so that it will trigger the first signin again.

Any help is appreciated. Thanks, Michael

dtpryce commented 3 years ago

Hey Michael,

Firstly thanks for using the library and logging an issue here!

The main small bit of data that is saved is within your bash profile so if you wish to return to a start state you only need to do something like:

Of course depending on if you are using sh, bash or zsh your bash profile will be different see https://github.com/wandera/1password-client/blob/f775be5ceb4fb2cc56fff1b7db8513b57cf9fc40/onepassword/utils.py#L21

If you wish to also delete the op cli you can but by removing the file and op.sig in your user bin directory but I don't think that will be necessary here - up to you if you want to start super fresh :) - since at every new kernel use of onepassword it will try to update and then log you in again.

Please return back here to discuss, and in the meantime we have made a ticket for implement a cleaning / reset functionality.

Cheers!

dtpryce commented 3 years ago

@motley74 also have you tried starting python / your notebook again and then trying again?

motley74 commented 3 years ago

I am using zsh and cannot find anything set in my .zshrc and I don't currently have a .zprofile. I also ran env | grep OP_ in a shell window and there doesn't seem to be anything set.

I did try restarting python and have rebooted my Mac several times which did not help. I also tried removing the 1password module and reinstalling it which did not help either.

dtpryce commented 3 years ago

I am using zsh and cannot find anything set in my .zshrc and I don't currently have a .zprofile. I also ran env | grep OP_ in a shell window and there doesn't seem to be anything set.

I did try restarting python and have rebooted my Mac several times which did not help. I also tried removing the 1password module and reinstalling it which did not help either.

Interesting ... I will create a ticket for one of us to look into, I personally don't use zsh but a couple of the team do, so will see if we can reproduce!

dtpryce commented 3 years ago

Did you also try removing the op cli itself and then running this client again?

dtpryce commented 3 years ago

@motley74 I think I have fixed this issue in a new version of the package and should also fix #12 🤞🏼 but will enforce the version of the cli to 1.8.0, any fresh install via pip should cater for this and then op update is available if people want to update the cli but for now we cannot guarantee that the python client will work with new versions - this will be updated in the README.

Keep an eye open for the new release and this has been tested on both MacOSX and a Linux distro for now.

dtpryce commented 3 years ago

@motley74 could you please try to use the newest version of the library (0.4.1), if you need any help with usage please create a new issue.

Ok for me to close this one?

motley74 commented 3 years ago

@dtpryce I will give it a go but it may take me a bit. I would say if you think you have fixed it then it is ok to close this. If necessary I will open a new issue or reopen this one.

dtpryce commented 3 years ago

@dtpryce I will give it a go but it may take me a bit. I would say if you think you have fixed it then it is ok to close this. If necessary I will open a new issue or reopen this one.

Thanks a bunch :) do try it out and open a new issue if you find out :D