简体   繁体   中英

Nexus 3 - Redirect to Create Repository page with authenticated user

I have a rails application which interacts with Nexus via API calls. For 'create repository' action, I want to redirect the user to the Nexus 3 page create repository page.

Create Repository requires an authenticated user. I understand we can make API calls which include an user information and authenticate and achieve this. But as I want to redirect them to the Nexus 3 page.

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. You can follow this guide to achieve that http://blog.sonatype.com/nexus-repository-new-beta-rest-api-for-content .

Note: Nexus 3 API are still in beta.

Once we obtain the token, the job becomes simpler. In all the APIs you send, we have to add the token and loggedIn attribute.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM