如何为服务帐户生成 API 密钥或令牌?
作为 JFROG Artifactory 的初学者,我对特定用例进行了澄清。在联系供应商支持之前检查我是否可以获得任何解决方案或指示。
我正在使用 Artifactory pro v.7.31.10。是否可以生成 API 密钥或 非管理员个人使用 JFROG API 作为服务帐户而不是 Artifactory 的人员 ID 访问令牌?
如何使用 Postman 生成 API 密钥或访问令牌?除了在 Postman 进行基本身份验证之外,我是否还需要传递任何参数(例如哪个用户)?我无法从知识文档中的示例中找到。
对于启用了 SAML 身份验证的 Artifactory HA 应用程序,我想限制用户使用其服务帐户(通用 ID)通过脚本下载工件,该帐户应该是 Artifactory 的本地帐户。我正在检查作为个人开发人员在运行时为其服务帐户获取 API 密钥或访问令牌的可能性,而不是由管理员为他们生成密钥或令牌。
我已经看到管理员创建访问令牌的示例,该令牌可以用作curl 中的不记名令牌。非管理员是否可以实现相同的目标?试图消除这里的依赖。
Being a beginner for JFROG Artifactory, I have clarification on a specific use case. Checking if I can get any solutions or directions before hitting the vendor support.
I am using the Artifactory pro v.7.31.10. Is it possible to generate the API Key or Access token by a non-admin individual using JFROG APIs for a service account instead of a human ID at Artifactory?
How can I generate an API key or an access token using Postman? Do I need to pass any parameters (such as for which user) other than having basic authentication at Postman? I couldn't find from the samples in the knowledge documentation.
For the Artifactory HA application which has SAML authentication enabled, I want to restrict users to download artifacts via their scripts using their service account (generic ids), which should be a local account at Artifactory. I am checking for the possibility of obtaining the API key or Access token as an individual developer for their service account at runtime rather than the admin generate a key or token for them.
I have seen samples for admin creates the access token which can be used as a bearer token in curl. Is it possible to achieve the same by a non-admin? Trying to remove the dependency over here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用以下 REST API 生成 API 密钥和访问令牌,
注意,管理员可以创建访问令牌对于任何用户和非管理员用户只能为自己创建 api 密钥和访问令牌。
同样,非管理员用户不能为其他用户创建 api 密钥和令牌,只能为自己创建。
You can use the below REST APIs to generate the API key and the access token,
Note, an admin can create access tokens for any user and a user who is not an admin can only create api keys and access tokens for himself.
Again, non-admin users cannot create api keys and tokens for other users but for himself.
根据我的经验,当应用程序在与创建它的数据中心不同的数据中心运行时,通过 UI 创建的访问令牌将无法在 DR 模式下工作,尽管为访问联合启用了信任圈。根据支持,这似乎是一个错误,将在 7.37 中修复。
使其工作的唯一其他选项是使用curl 或Postman 作为管理员调用api。非管理员无法为其他人创建访问令牌。但是,我无法以非管理员身份为自己创建访问令牌。这似乎是一个问题。启用 SAML 后,我尝试通过浏览器创建访问令牌,但无法继续。尝试通过 Postman 创建时遇到问题。
最后只有管理员才能创建。
Based on my experience, the access token created via UI will not work in DR mode when app is running at a different data center than where it was created, though the circle of trust is enabled for access federation. This seems to be a bug which will be fixed in 7.37, per support.
The only other option to make it work is by calling the api using curl or Postman as admin. Non-admins cannot create an access token for others. However, I couldn't create the access token for myself as an non-admin. This seems to be an issue. While SAML is enabled, I tried to create the access token via browser and couldn't able to proceed. Was getting issue while trying to create via Postman.
At the end, only admin was able to create.