Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot deploy as One Time Password is not provided. #74

Open
ravn opened this issue Jul 13, 2022 · 6 comments
Open

Cannot deploy as One Time Password is not provided. #74

ravn opened this issue Jul 13, 2022 · 6 comments

Comments

@ravn
Copy link

ravn commented Jul 13, 2022

I am new to jdeploy (my idea is to make Apache Maven more accessible by providing a jdeploy installer) and ran into this showstopper when trying to deploy my tiny proof-of-concept app.

npm notice Publishing to https://registry.npmjs.org/
npm ERR! code EOTP
npm ERR! This operation requires a one-time password from your authenticator.
npm ERR! You can provide a one-time password by passing --otp=<code> to the command you ran.
npm ERR! If you already provided a one-time password then it is likely that you either typoed
npm ERR! it, or it timed out. Please try again.

Being new to this I do not know when OTP were introduced but it is clearly after the jdeploy documentation was written.

Would the simplest fix be to add a textbox to provide the OTP in and then pass it down using the --otp=... flag if provided?

@shannah
Copy link
Owner

shannah commented Jul 13, 2022

It does try to deal with the one-time password but it is flakey. It has been reported that updating NodeJS to the latest fixes this issue. An alternative workaround for now, is to first login using the CLI. (i.e. npm login), then do your publish.

@ravn
Copy link
Author

ravn commented Jul 13, 2022

I had installed the LTS version of node.js, which had 8.11 of npm. Upgrading manually to 8.13.2 with packages, (which in the process upgraded jdeploy to 3.2.0) and logging in again did not change the error message.

This is under MacOS 12.4 x64.

Suggestions?

@shannah
Copy link
Owner

shannah commented Jul 13, 2022

So you're logged in in the CLI with npm and it still doesn't work? See #33

@ravn
Copy link
Author

ravn commented Jul 14, 2022

Yes. I have enabled 2FA for NPM with a suitable authenticator, which might be a mistake given this.

What is the correct place to add the --otp=xxxx snippet in the JDeploy GUI? (Better to ask than guess these things)

@shannah
Copy link
Owner

shannah commented Jul 14, 2022

The jDeploy GUI will try to identify when the CLI prompts for it, and it will give you a dialog box to enter the OTP. But this is currently version-dependent as it uses heuristics to identify this.

If this isn't working, then you should

  1. Login using the npm command line. (If you can type npm whoami and it gives your username, then you're logged in).
  2. Publish using either the jDeploy GUI or the jDeploy CLI. From the cli, it is just jdeploy publish.

@EtienneLamoureux
Copy link

EtienneLamoureux commented Nov 21, 2023

Had the same problem, fixed using by doing:

  1. Login into npmjs.com
  2. Go to the account setting, the "Manage Two-Factor Authentication"
  3. In the "Additional Options" section, uncheck "Require two-factor authentication for write actions"
  4. Click the "Update Preferences" button
  5. Run jdeploy publish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants