Rest Authentification

14 views
Skip to first unread message

Maatary Okouya

unread,
Dec 17, 2014, 4:08:29 PM12/17/14
to sta...@clarkparsia.com
Hi, 

I'd like to use the rest service of Stardog. However, it seams that without disabling the authentification there is nothing i can do. Is there a way to authentify via the rest interface. For instance, i was trying to get the size via the rest api: /db/size. I got a 401 error. 


Could you help many thanks
 

Evren Sirin

unread,
Dec 17, 2014, 4:16:53 PM12/17/14
to Stardog
Stardog uses HTTP basic authentication so you can provide the
credentials in any tool that supports it. For example in curl you'd
do:

$ curl -sku admin:admin http://localhost:5820/test/size

Best,
Evren
> --
> -- --
> You received this message because you are subscribed to the C&P "Stardog"
> group.
> To post to this group, send email to sta...@clarkparsia.com
> To unsubscribe from this group, send email to
> stardog+u...@clarkparsia.com
> For more options, visit this group at
> http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
Message has been deleted

Maatary Okouya

unread,
Dec 17, 2014, 4:51:59 PM12/17/14
to sta...@clarkparsia.com
Here is what i produce using my rest client: 

GET /SkosDB/size HTTP/1.1
Content-Type: application/json
Authorization: admin:admin
Host: localhost:5820
Connection: close
User-Agent: Paw/2.1 (Macintosh; OS X/10.9.5) GCDHTTPRequest


Here is what stardog returns me: 

500 You must initialize the xml-security library correctly before you use it. Call the static method "com.sun.org.apache.xml.internal.security.Init.init();" to do that before you use any functionality from that library.

any idea of what that might means.

Kendall Clark

unread,
Dec 17, 2014, 5:32:20 PM12/17/14
to sta...@clarkparsia.com


On Wednesday, December 17, 2014, Maatary Okouya <maatar...@gmail.com> wrote:
Here is what i produce using my rest client: 

GET /SkosDB/size HTTP/1.1
Content-Type: application/json
Authorization: admin:admin

If this is what yr "rest client" is sending yr either using it wrong or it's junk.

HTTP Basic Authentication is what Stardog uses. 

See http://luckymarmot.com/paw/doc/HTTP_Basic_Auth for setting it up with yr REST client.

Cheers,
Kendall 

Maatary Okouya

unread,
Dec 17, 2014, 5:50:43 PM12/17/14
to sta...@clarkparsia.com
Everything works fine. Thanks for the link
Reply all
Reply to author
Forward
0 new messages