[one-ecosystem] [rOCCI server]: Authentication & Response format

Feldhaus, Florian florian.feldhaus at gwdg.de
Wed Oct 31 02:45:35 PDT 2012


Hi John,

Am 31.10.2012 um 10:24 schrieb <samon at ucnet.uoc.gr>
 <samon at ucnet.uoc.gr>:

>  
> Hi!  
>  
> I need some help with rOCCI server.
>  
> In older version of occi server (Server: Ruby OCCI Framework/0.4 OCCI/1.1, downloaded
> from http://dev.opennebula.org/projects/ogf-occi/ ) I use curl in order to get the vms without
> providing authentication credentials. For example  I submit:
>  
> curl  -v -X GET  http://mydomain:3000/compute/
>  
> I use the occi-server.conf to provide username/password. Specifically, inside this file I write:
> ONE_USER=myuser
> ONE_PASSWORD=mypass
>  
> However, in rOCCI server, I use now, (Server: rOCCI/0.5.0 OCCI/1.1)  I can’t find where to place
> username/password and thus, I have to submit the requests with credentials like this:
>  
> curl  -u myuser:mypass -v -X GET  http://mydomain:3000/compute/
>  
> Is it possible to place username/password in a file so as not to have to provide credential
> in my requests?  I use java to make request on occi server, and now, I have to find out
> how to provide username/password …

We changed the way to handle authentication to allow different methods. There is still a default authentication, but currently you can't configure it. Could you please create an issue here describing your request:
https://github.com/gwdg/rOCCI-server/issues

A quick fix would be to replace the user 'anonymous' in line 103 of file lib/occi/server.rb with the user you like to use by default when no authentication is provided.

> One more question: I notice that responses of rOCCI server (Server: rOCCI/0.5.0 OCCI/1.1)  
> are in XML format.  Are other formats supported? If not, I have to modify my java code to handle this
> format. The current version of my code handle http responses, like those I receive
> from older version of occi server (Server: Ruby OCCI Framework/0.4 OCCI/1.1.)

Just add the content type you would like to get in the HTTP Accept header. e.g. using

curl  -v -H 'Accept: text/plain' -X GET  http://mydomain:3000/compute/

rOCCI-server supports
text/plain
text/occi
application/occi+json (rendering in rOCCI-server 0.5 not yet compatible with latest draft of JSON specification)
application/occi+xml (not specified yet)

Cheers,
Florian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/ecosystem-opennebula.org/attachments/20121031/b31b7031/attachment-0002.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4964 bytes
Desc: not available
URL: <http://lists.opennebula.org/pipermail/ecosystem-opennebula.org/attachments/20121031/b31b7031/attachment-0002.bin>


More information about the Ecosystem mailing list