[Kea-users] Stork API Key

Stefan G. Weichinger lists at xunil.at
Tue Dec 13 08:26:47 UTC 2022


Am 12.12.22 um 16:39 schrieb Eric Graham:
> Hi Stefan,
> 
> As far as I am aware, there's no token. Send a POST to /sessions and use 
> the "session" cookie to authenticate, as so:
> 
> ➜ curl -k -c cookie.txt -X POST -H 'Content-Type: application/json' 
> https://127.68.45.99/api/sessions -d '{"useremail": "admin", 
> "userpassword": "your password here"}'
> {"email":"admin at yourdomain.local","groups":[1],"id":2,"lastname":"Admin","login":"admin","name":"Test Admin"}
> 
> ➜ cat cookie.txt
> # Netscape HTTP Cookie File
> # https://curl.se/docs/http-cookies.html
> # This file was generated by libcurl! Edit at your own risk.
> 
> #HttpOnly_10.0.7.11     FALSE   /       FALSE   1670945665      session 
> jWZUnuCYYhs6seDTKpliwnp4eIWHIA1ObVi_Ior_YYLk
> 
> ➜ curl -k -X GET -H 'Content-Type: application/json' -b cookie.txt 
> https://127.68.45.99/api/users
> {"items":[{"email":"admin at yourdomain.local","groups":[1],"id":2,"lastname":"Admin","login":"admin","name":"Test Admin"}],"total":1}
> 
> ------------------------------------------------------------------------

Great, works here ... does that cookie have a lifetime, does it time out ?

thanks




More information about the Kea-users mailing list