Skip to content

Is the documentation for authentication up to date? I need cookies to login via username&password #209

Description

@MW3000

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions