Replies: 3 comments 1 reply
-
Now you will have a correct
The secret is used to verify the jwt payload. If you change it, all existing tokens become invalid.
You are correct. The
As you can see here, it took yarn until v4 to get the login process working properly with Verdaccio. However, yarn 1 should work with |
Beta Was this translation helpful? Give feedback.
-
@jampy @mbtools Since https://github.com/verdaccio/verdaccio/releases/tag/v5.31.0 was introduced You are using version 6.x you can use
yes, the secret is used for singing tokens, either if you use
If you don't use the
Only if you choose use JWT but by default (legacy) does not expires. Regarding JWT The request to the API can be set either For such cases you can use security:
web:
sign:
expiresIn: 1h # 1 hour by default
verify:
someProp: [value] |
Beta Was this translation helpful? Give feedback.
-
32 checkSecret 😉 |
Beta Was this translation helpful? Give feedback.
-
I just installed Verdaccio 6.0.0 (
verdaccio/verdaccio:6.0.0
Docker image). It should act as a private NPM proxy/cache and also host a handful of private packages.My goal is to have a single Verdaccio user with a certain password and have a long-term NPM/Yarn configuration (though Kubernetes secrets) that is able to login to Verdaccio. User registration should be disabled (
max_users: -1
)since Verdaccio by default uses a so-called
htpasswd
mechanism I tried to create a typicalhtpasswd
file by usingprintf "USER:$(openssl passwd -5 -stdin)\n"
, which usually works with HTTP servers. That didn't work. I guess Verdaccio expects a certain (different) format/hashing mechanism.npm register
to create a working.htpasswd
on the server and saving it (I want to store it as a read-only Kubernetes secret).I tried to enable authentication on Yarn v1 following this description, but could not get Yarn to ask for the password
I moved on to authenticate using standard
npm
(since Yarn should also support it).npm login
succeded. It wrote an_authToken
(100 characters) to the.npmrc
./verdaccio/storage/data/.verdaccio-db.json
on the server containing{"list":[],"secret":"xxxxxxx"}
(secret is 32 characters long)..verdaccio-db.json
JSON structure implies that since the secret is not part of an array or similar.Authentication
config section, which talks about legacy and JWT token signature. I'm not sure which kind of token my setup uses now. The page says that the legacy property is enabled by default so I think it is a legacy secret.security.api.jwt.sign.expiresIn
config option but obviously that does not apply to the "legacy" tokens I guess. Is there an "expire" option for those legacy tokens?legacy: true
setting and configures thejwt
section, which should activate JWT. Isn't that a contradiction?I would be happy if you could help me understand how the configuration works. Thanks a lot in advance!
The
config.yaml
I'm using at the moment:Beta Was this translation helpful? Give feedback.
All reactions