The authentication.md document suggests the following to login via username&password:
curl -v -X POST https://{dspace-server.url}/server/api/authn/login --data "user=dspacedemo%2Badmin%40gmail.com&password=dspace" -H "X-XSRF-TOKEN: {csrf-token}"
This method fails every time.
I found, the only way to login is to also send the XSRF cookie, like this:
curl -v -X POST https://{dspace-server.url}/server/api/authn/login --data "user=dspacedemo%2Badmin%40gmail.com&password=dspace" -H "X-XSRF-TOKEN: {csrf-token}" -b "DSPACE-XSRF-COOKIE={xsrf-cookie}"
If this is correct, and the cookie is needed, it should be documented in authentication.md
I found the necessity to send the cookie also documented in a comment on the wiki: https://wiki.lyrasis.org/display/DSPACE/REST+Authentication?focusedCommentId=230828636#comment-230828636
The
authentication.mddocument suggests the following to login via username&password:curl -v -X POST https://{dspace-server.url}/server/api/authn/login --data "user=dspacedemo%2Badmin%40gmail.com&password=dspace" -H "X-XSRF-TOKEN: {csrf-token}"This method fails every time.
I found, the only way to login is to also send the XSRF cookie, like this:
curl -v -X POST https://{dspace-server.url}/server/api/authn/login --data "user=dspacedemo%2Badmin%40gmail.com&password=dspace" -H "X-XSRF-TOKEN: {csrf-token}" -b "DSPACE-XSRF-COOKIE={xsrf-cookie}"If this is correct, and the cookie is needed, it should be documented in
authentication.mdI found the necessity to send the cookie also documented in a comment on the wiki: https://wiki.lyrasis.org/display/DSPACE/REST+Authentication?focusedCommentId=230828636#comment-230828636