api de gestion de ticket, basé sur php-crud-api. Le but est de décorrélé les outils de gestion des données, afin
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

client_bash_auth.sh 594B

12345678910111213141516
  1. #!/bin/bash
  2. # initialize cookie store
  3. cp /dev/null cookies.txt
  4. # login and store cookies in 'cookies.txt' AND retrieve the value of the XSRF token
  5. TOKEN=`curl 'http://localhost/api.php/' --data "username=admin&password=admin" --cookie-jar cookies.txt --silent`
  6. # strip the double quotes from the variable (JSON decode)
  7. TOKEN=${TOKEN//\"/}
  8. # set the XSRF token as the 'X-XSRF-Token' header AND send the cookies to the server
  9. curl 'http://localhost/api.php/posts?include=categories,tags,comments&filter=id,eq,1' --header "X-XSRF-Token: $TOKEN" --cookie cookies.txt
  10. # clean up
  11. rm cookies.txt