Hi,

the session handling of Graylog is kind of special (i. e. using a very 
custom mechanism).

You'll have to use the session ID as user name and the special password 
"session" as credentials and send those as standard Authorization header 
(Basic Auth) to the Graylog server.

In the end your requests will look like 
http://${SESSION_ID}:[email protected]:12900/foo/bar.


Cheers,
Jochen

On Tuesday, 28 July 2015 16:21:56 UTC+2, Emde wrote:
>
> Hello,
>
> I am accesing the REST API of Graylog from java.
>
> I want to use a sessionId to make the calls to the REST api without 
> username and password. I haven't found any documentation reading how this 
> should be set in order for graylog to accept it. I have tried the following 
> and all of them return 401 Unauthorized:
>
> URLConnection graylogConnection = graylogUrl.openConnection();
> graylogConnection.setRequestProperty("sessionid", sessionId);
> graylogConnection.setRequestProperty("session-id", sessionId);
> graylogConnection.setRequestProperty("session_id", sessionId);
> graylogConnection.setRequestProperty("id", sessionId);
> graylogConnection.setRequestProperty("authorization", "Bearer " + 
> sessionId);
> graylogConnection.setRequestProperty("JSESSIONID", sessionId);
> graylogConnection.setRequestProperty("Cookie", "JSESSIONID=" + sessionId);
>
> I got the sessionId value from the system/sessions resource and has a 
> valid expiry date(it is not expired).
> I also tried all of the above with sessionId Base64 encoded.
>
> Could anyone suggest how I should set the sessionId in order for graylog 
> to accept it?
>

-- 
You received this message because you are subscribed to the Google Groups 
"graylog2" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to