我有一个nexus服务器,我们用它来服务我们的java jar。
我们已经为我们的项目创建了一个repo,它要求客户端传递用户名和密码来下载maven依赖项。
现在,我们还需要一个repo,用户可以从其中下载工件,而不需要传递任何凭据。
是否可以在一台Nexus OSS服务器上托管两个repos,一个由基本身份验证支持,另一个允许匿名访问?
发布于 2021-11-16 10:50:05
我报告的解决方案在https://support.sonatype.com/hc/en-us/articles/360050779593-How-to-grant-anonymous-access-to-a-specific-repository-上进行了解释:
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-accesshttps://stackoverflow.com/questions/69984969
复制相似问题