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

--
All messages to this mailing list should adhere to the Code of Conduct: 
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
--- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/d84c4ab4-959e-8e43-8a93-76faa24b06b6%40bibliothek.uni-kassel.de.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to