Skip to content
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

Signed URLs: If target user account does not yet have an API Token, requestURL fails, even though request made with valid token. #9405

Open
kcondon opened this issue Feb 23, 2023 · 0 comments

Comments

@kcondon
Copy link
Contributor

kcondon commented Feb 23, 2023

When requesting a signed url as a super user but for permissions for a new non super user, it fails with "Do not have a valid user with apiToken". In this case it is referring to the the target user who has not yet created an api token for their account.

Discussed with Jim and he thought the request should create a token if there was not yet one and so a bug.
"a bug - the API key is used in creating/validating the signature so this call should probably be creating one if needed."

Relevant command lines:

JSON='{"url":"https://dataverse-internal.iq.harvard.edu/api/v1/datasets/:persistentId/?persistentId=doi:10.70122/FK2/AH9UIE","timeOut":35,"user":"kc022223"}'

curl -k -H "X-Dataverse-key:$API_KEY" -H 'Content-Type:application/json' -d "$JSON" http://localhost:8080/api/admin/requestSignedUrl

{"status":"ERROR","message":"Do not have a valid user with apiToken"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant