Hi Kosmas,
Am 08.11.21 um 08:48 schrieb Kosmas Kaifel:
> Good morning,
>
> can someone give me an example, how can I login into the REST-API via curl.
[…]
tried upgrading our DSpace5 last Friday and tested the login to the API:
curl -c - -XGET https://<YOUR-SERVER>/server/api/login
You will get a Cookie named "DSPACE-XSRF-COOKIE" and its value.
Now try
curl -i -b "DSPACE-XSRF-COOKIE=<YOUR-COOKIE>" -H "X-XSRF-TOKEN:
<YOUR-COOKIE>" -XPOST https://<YOUR-SERVER>/server/api/authn/login -d
'user=YOUR-USER&password=YOUR-PASSWORD'
In the answer you will receive a new DSPACE-XSRF-TOKEN and a Bearer
Token you need for further access.
https://wiki.lyrasis.org/display/DSPACE/REST+Authentication
https://github.com/DSpace/RestContract/blob/main/csrf-tokens.md
CU
Michael