javascript - How to create a Token in Nexus (for private packages) ? can't create a token through its UI - Stack Overflo

We're using Sonatype Nexus Repository ManagerOSS 3.29.0-02 and we're trying to create a TOKEN

We're using Sonatype Nexus Repository ManagerOSS 3.29.0-02 and we're trying to create a TOKEN to work with .npmrc in the following structure :

registry=http://NEXUS-IP:8081/repository/GROUP-NAME
http://NEXUS-IP:8081/repository/GROUP-NAME/:_authToken=NpmToken.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX

When I'm logged into the Sonatype Nexus Repository ManagerOSS I can't find anything that creates a valid token.

However , when I hit npm login from the mand line and type the Username and Password , the npm install works.

How can we create a valid TOKEN for those Username/Password pair for the Nexus Artifactory , so I'll be able to use that token from a Docker ?

We're using Sonatype Nexus Repository ManagerOSS 3.29.0-02 and we're trying to create a TOKEN to work with .npmrc in the following structure :

registry=http://NEXUS-IP:8081/repository/GROUP-NAME
http://NEXUS-IP:8081/repository/GROUP-NAME/:_authToken=NpmToken.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX

When I'm logged into the Sonatype Nexus Repository ManagerOSS I can't find anything that creates a valid token.

However , when I hit npm login from the mand line and type the Username and Password , the npm install works.

How can we create a valid TOKEN for those Username/Password pair for the Nexus Artifactory , so I'll be able to use that token from a Docker ?

Share Improve this question asked Dec 23, 2020 at 12:26 JANJAN 21.9k66 gold badges189 silver badges336 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 1

It appears that authenticating w/ AuthTokens (i.e. User Token Realm ) is only available in Nexus Pro :

https://help.sonatype./repomanager3/nexus-repository-administration/user-authentication/security-setup-with-user-tokens

User tokens is available only in PRO version of Nexus (see parison), but you can use "Single sign-on patch for Nexus OSS" which provides an alternative implementation of tokens without violating the license. The creation of tokens is implemented through the "NuGet API Key" menu, however, the tokens themselves apply to all types of repositories. Example of usage user token:

  1. Run Nexus container from image "ghcr.io/a-langer/nexus-sso:3.46.0":

    git clone https://github./a-langer/nexus-sso.git
    cd ./nexus-sso
    docker pose up -d 
    
  2. Go to menu "Nexus -> Manage your user account -> NuGet API Key", press "Access API key".

  3. Type your password or username if using SSO login, press "Authenticate".

  4. Copy "Your NuGet API Key", press "Close" and "Sign out".

  5. The received token can be used instead of a password in settings NPM, Docker, Maven and etc.

Each user can set a personal token that can be used instead of a password.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744289083a4566945.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信