首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在Nexus服务器上设置经过身份验证的maven存储库

在Nexus服务器上设置经过身份验证的maven存储库
EN

Stack Overflow用户
提问于 2021-11-16 07:03:00
回答 1查看 35关注 0票数 1

我有一个nexus服务器,我们用它来服务我们的java jar。

我们已经为我们的项目创建了一个repo,它要求客户端传递用户名和密码来下载maven依赖项。

现在,我们还需要一个repo,用户可以从其中下载工件,而不需要传递任何凭据。

是否可以在一台Nexus OSS服务器上托管两个repos,一个由基本身份验证支持,另一个允许匿名访问?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-11-16 10:50:05

我报告的解决方案在https://support.sonatype.com/hc/en-us/articles/360050779593-How-to-grant-anonymous-access-to-a-specific-repository-上进行了解释:

代码语言:javascript
复制
To restrict anonymous access to a single repository you can create your own anonymous role with targeted permissions and assign it to the anonymous user.

1. Create a new role with the permissions you would like to grant to the anonymous user.

For example, the following allows read and browse privileges to a maven2 repository:

nx-repository-view-maven2-<repo-id>-read
nx-repository-view-maven2-<repo-id>-browse

The read privilege allows downloads, and the browse privilege allows a user to see the repository's contents in the UI.

You may also want to add the "nx-search-read" privilege to allow searching.

2. Then in Security > Users remove the default nx-anonymous role from the anonymous user, and replace it with the new role.

3. Make sure anonymous access is enabled in Security > Realms. Verify that the "local authenticating realm" and "local authorizing realm" are in the active realm list.

4. Make sure anonymous access is enabled. In Security > Anonymous make sure the check box to Allow anonymous access to the server is checked.  Also make sure the realm of the anonymous user is "local authorizing realm". 

Additional documentation regarding anonymous access is provided here:

https://help.sonatype.com/repomanager3/system-configuration/user-authentication/anonymous-access
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69984969

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档