CI/CDDevOps

How to set: _auth in .npmrc when using a Nexus https npm registry proxy?

Content of .npmrc file:

; Nexus proxy registry pointing to http://registry.npmjs.org/
registry=https://nexus.itcapsula.com:8081/repository/npm-registry-hosted/
@gefenconnect:registry=https://nexus.itcapsula.com:8081/repository/npm-registry-hosted/
; //nexus.itcapsula.com:8081/:_authToken=bedc8bbe-686d-37e1-a3dd-3921596c6b95
; base64 encoded authentication token
_auth= <see how to create a base64 encoded username&password below>
; required by Nexus
email=nexus_email_account@itcapsula.com
; force auth to be used for GET requests
always-auth=true
; we don't want to put certificates in .npmrc
strict-ssl=false
loglevel=silly

How to Set/create “_auth” base64Encode(:)

$ echo -n 'username:password' | openssl base64
For example:
# echo -n 'admin123:admin123' | openssl base64
you wil get the below output:
YWRtaW4xMjM6YWRtaW4xMjM=

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

6Mty8

Please type the text above:

Close
Close