2017-08-31 41 views

回答

0

SlashDB具有基于cookie的会话管理。每当用户使用用户名/密码登录GUI时,都会生成/检查cookie。尽管通常API key的无状态机制是首选,但可以从客户端应用程序使用基于cookie的方法。

curl 'https://your-slashdb-host/login' -v 
-H 'Pragma: no-cache' 
-H 'Origin: https://demo.slashdb.com' 
-H 'Accept-Encoding: gzip, deflate' 
-H 'Accept-Language: en-US,en;q=0.8,pl;q=0.6,fr;q=0.4' 
-H 'Content-Type: application/json;charset=UTF-8' 
-H 'Accept: application/json, text/plain, */*' 
-H 'Cache-Control: no-cache' 
-H 'Referer: http://myslashdbhost/' 
-H 'Connection: keep-alive' 
--data-binary '{"login":"someuser","password":"secret-password"}' 
--compressed 

的响应将包含cookie头

Set-Cookie: auth_tkt=ffeef88c70bda165db830dxxb35b503559a6c5b0YWRtaW4%3D!userid_type:b64unicode; Max-Age=3600; Path=/; expires=Wed, 30-Aug-2017 15:03:28 GMT