-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data Access API does not support X-Dataverse-key header #2662
Comments
I feel I should fix this in 4.3, since this is kind of a security thing. |
Should be ready for QA. Testing: You can try downloading a restricted file, for example: wget -O /tmp/test.out http://localhost:8080/api/access/datafile/NNNN the above should fail with a 403. Now with the api token, sent in the new header: wget -O /tmp/out.txt --header "X-Dataverse-key: YOURAPITOKEN" http://localhost:8080/api/access/datafile/NNN this should work, assuming the supplied token was legit. |
OK, works with both command line and header versions. Closing. |
http://guides.dataverse.org/en/4.2/api/native-api.html says, "Calls that do require authentication require the user’s API key. That key can be passed either via an extra query parameter, key, as in ENPOINT?key=API_KEY, or via the HTTP header X-Dataverse-key" but I can't get the X-Dataverse-key header to work with the Data Access API.
This works:
curl http://localhost:8080/api/access/datafile/12?key=$API_TOKEN
This doesn't work:
curl -H "X-Dataverse-key:$API_TOKEN" http://localhost:8080/api/access/datafile/12
I believe we want both to work. The header version was introduced in #2123 so that some day we can deprecate the query parameter version.
The text was updated successfully, but these errors were encountered: