[英]Nexus 3 - Redirect to Create Repository page with authenticated user
I have a rails application which interacts with Nexus via API calls. 我有一个Rails应用程序,可通过API调用与Nexus进行交互。 For 'create repository' action, I want to redirect the user to the Nexus 3 page create repository page.
对于“创建存储库”操作,我想将用户重定向到Nexus 3页面的“创建存储库”页面。
Create Repository requires an authenticated user. 创建存储库需要经过身份验证的用户。 I understand we can make API calls which include an user information and authenticate and achieve this.
我了解我们可以进行包含用户信息的API调用并进行身份验证并实现这一目标。 But as I want to redirect them to the Nexus 3 page.
但是,由于我想将它们重定向到Nexus 3页面。
There I do not want the user to authenticate again. 在那里,我不希望用户再次进行身份验证。 Is it possible that we can redirect the user to nexus page as an authenticated user?
我们是否可以将用户作为经过身份验证的用户重定向到联系页面?
First of all, this is doable . 首先,这是可行的 。 As a first step, we need to authenticate our user from our application with nexus 3 and obtain one time token for the user.
第一步,我们需要使用nexus 3从我们的应用程序对用户进行身份验证,并为该用户获取一个时间令牌。 You can follow this guide to achieve that http://blog.sonatype.com/nexus-repository-new-beta-rest-api-for-content .
您可以按照本指南来实现http://blog.sonatype.com/nexus-repository-new-beta-rest-api-for-content 。
Note: Nexus 3 API are still in beta. 注意:Nexus 3 API仍处于测试阶段。
Once we obtain the token, the job becomes simpler. 一旦获得令牌,工作将变得更加简单。 In all the APIs you send, we have to add the token and loggedIn attribute.
在您发送的所有API中,我们必须添加令牌和loggingIn属性。
For example, 例如,
http://nexus3_domain?sfLoginToken=#{one_time_token}&isLoggedIn=true/#browse/browse:Test
And the user is now redirected to the repo Test as an authenticated user. 现在,该用户已通过身份验证的用户重定向到回购测试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.