-
Notifications
You must be signed in to change notification settings - Fork 491
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
Includes new token's expiration date in "users/token/recreate" endpoint #10858
Includes new token's expiration date in "users/token/recreate" endpoint #10858
Conversation
Changes unknown |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@GPortas Hey - can you please update the pull request with the latest from develop. |
…piration-date-to-recreate-token-api
📦 Pushed preview images as
🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
omerfahim@HMDC-HMDCs-MacBook-Pro dataverse % curl -H "X-Dataverse-key:5a6185e1-e0a2-4b7e-b6a6-62da5b854e22 " -X POST "https://dataverse-internal.iq.harvard.edu/api/users/token/recreate?returnExpiration=true" Was testing again today and noticed that the Expiration date on the UI doesn't match up with the expiration date on the API call. - This is likely due to the UI following EST timezone and API using UTC timezone. |
What this PR does / why we need it:
An optional query parameter called 'returnExpiration' has been added to the 'users/token/recreate' endpoint, which, if set to true, returns the expiration time in the response message.
Which issue(s) this PR closes:
Special notes for your reviewer:
I've kept the string messages as responses for backward compatibility, although it would be interesting to use JSON responses in the future, as multiple properties are being returned in the same response message.
Suggestions on how to test this:
For obtaining a new token without its expiration time (current behavior)
curl -H "X-Dataverse-key:$API_TOKEN" -X POST "$SERVER_URL/api/users/token/recreate"
This endpoint by default will return a response message indicating the user identifier and the new token.
For obtaining a new token with its expiration time
curl -H "X-Dataverse-key:$API_TOKEN" -X POST "$SERVER_URL/api/users/token/recreate?returnExpiration=true"
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
No
Is there a release notes update needed for this change?:
Yes, attached.
Additional documentation:
No