2017-08-31 82 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