Hi Norbert,

see 
http://docs.graylog.org/en/2.1/pages/configuration/rest_api.html#creating-and-using-access-token
 
for instructions about using access tokens with the Graylog REST API.

If, after reading the documentation carefully, you're still unable to make 
the access token work, please post your complete curl commands and do not 
obfuscate any data (except maybe the username and the password you're 
creating the token with).

Cheers,
Jochen

On Monday, 9 January 2017 12:03:45 UTC+1, Norbert Kiss wrote:
>
> Hi
>
> What I did wrong?
>
> I create a token, and if I try to use the token to get an url under 
> /api/system , I get Unauthorized back.
>
> Thanks,
>
> Norbert
>
>
> curl -u USER:PASS -H 'Accept: application/json' -X GET 
> 'http://IP:9000/api/users/USER/tokens?pretty=true'
> {
>   "tokens" : [ {
>     "name" : "NAME",
>     "token" : "TOKENID",
>     "last_access" : "1970-01-01T00:00:00.000Z"
>   } ]
> }
>
> curl http://IP:9000/api/system -u TOKENID:token -i
> HTTP/1.1 401 Unauthorized
> WWW-Authenticate: Basic realm="Graylog Server"
> X-Graylog-Node-ID: XX
> X-Runtime-Microseconds: 490
> Date: Mon, 09 Jan 2017 10:58:23 GMT
> Content-Length: 0
>
>
> curl http://IP:9000/api/system -u USER:PASS -i
> HTTP/1.1 200 OK
> X-Graylog-Node-ID: XX
> X-Runtime-Microseconds: 244491
> Content-Type: application/json
> Date: Mon, 09 Jan 2017 10:58:40 GMT
> Content-Length: 402
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Graylog Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to graylog2+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/graylog2/e0280d91-80f4-41e7-8547-da81f7ee4bb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to