Dear colleagues, help me solve the problem:
create the relationship isAuthorOfPublication between the publication and 
the author by REST API.
I did:
receive Bearer token - 
curl -v -X POST  --data "user=<root-email>&password=<password>" 
"https://<api server uri>/server/api/authn/login" -H "X-XSRF-TOKEN: 
{csrf-token}" --cookie "DSPACE-XSRF-COOKIE={csrf-token}"

run curl - 
curl -i -X POST 'https://<api server 
uri>/server/api/core/relationships?relationshipType=1' -H 'X-XSRF-TOKEN: 
{csrf-token}' --cookie 'DSPACE-XSRF-COOKIE={srf-token}' -H 'Authorization: 
Bearer eyJhbGciOiJIUzI1NiJ...' -H 'Content-Type:text/uri-list' --data 
'https://<api server uri>/server/api/core/items/<author dspace 
uuid>\nhttps://<api server uri>/server/api/core/items/<publication dspace 
uuid>'

receive - error 403
HTTP/1.1 403
Date: Mon, 10 Mar 2025 05:56:27 GMT
Server: Apache/2.4.37 (Oracle Linux Server) OpenSSL/1.1.1k
Vary: Origin,Access-Control-Request-Method,Access-Control-Request-Headers
DSPACE-XSRF-TOKEN: 1c2814d0-c97a-4f1d-9a65-2b49a83e1028
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Type: application/json;charset=UTF-8
Set-Cookie: DSPACE-XSRF-COOKIE=; Path=/server; Max-Age=0; Expires=Thu, 01 
Jan 1970 00:00:00 GMT; Secure; HttpOnly; SameSite=None
Set-Cookie: DSPACE-XSRF-COOKIE=1c2814d0-c97a-4f1d-9a65-2b49a83e1028; 
Path=/server; Secure; HttpOnly; SameSite=None
Access-Control-Allow-Origin: https://<api server uri>
Access-Control-Allow-Methods: GET, POST, OPTIONS, PATCH, DELETE
Access-Control-Allow-Headers: Content-Type, Authorization, x-referrer, 
x-correlation-id, x-xsrf-token
Access-Control-Allow-Credentials: true
Transfer-Encoding: chunked

{"timestamp":"2025-03-10T05:56:27.687+00:00","status":403,"error":"Forbidden","message":"Access
 
is denied. Invalid CSRF token.","path":"/server/api/core/relationships"}

Help me please.

Best regards,
Alex

-- 
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 dspace-tech+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/dspace-tech/c69e08b1-8746-4358-b06d-cf5eb47f7dd1n%40googlegroups.com.

Reply via email to