Post

1 follower Follow
0
Avatar

REST samples available

Are there any REST samples available for version 3.8? I have trouble accessing resources.

E.g.

<myip>:4516/security/role/

 

results in a 404 while http://docs.xebialabs.com/releases/3.8/deployit/rest-api/com.xebialabs.deployit.engine.api.RoleService.html suggest that this url is correct. I also cannot find any info on how credentials can be passed (basic authentication header?).

rswart Answered

Please sign in to leave a comment.

5 comments

0
Avatar

You should indeed use Basic Authentication.

From http://en.wikipedia.org/wiki/Basic_access_authentication: 

The Authorization header is constructed as follows:

  1. Username and password are combined into a string "username:password"
  2. The resulting  string literal is then encoded using  Base64
  3. The authorization method and a space i.e. "Basic " is then put before the encoded string.

For example, if the user agent uses 'Aladdin' as the username and 'open sesame' as the password then the header is formed as follows:

Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

XebiaLabs Support 0 votes
0
Avatar

I think it's a problem with the url:

<myip>:4516/security/role/

should be

<myip>:4516/deployit/security/role/

Richard Woudenberg 0 votes
0
Avatar

Thanks. I know how to create a basic authentication header, but if authentication would be the problem I would expect a 401 Unauthorized and not a 404.

 

What would be the correct url for /security/role/. Do I need to prefix all rest urls with a context root?

rswart 0 votes
0
Avatar

Hi Richard,

Yes, you're right, the "/deployit" part should be prefixed to the URL. I've created documentation bug DEPLOYITPB-3134 on our internal issue database for this.

Regards, Vincent.

XebiaLabs Support 0 votes
0
Avatar

Hi Richard,

 

Prefexing deployit works. Thanks!

 

Note that this is not clear from the documentation.

 

Regards,

 

Richard

 

 

rswart 0 votes