Machine-detectable response code for "Password confirmation is required" #37377
Labels
0. Needs triage
Pending check for reproducibility or if it fits our roadmap
developer experience
enhancement
feature: authentication
How to use GitHub
Background
I am using the Nextcloud API to create users, groups and similar from an external software (a Drupal website).
I noticed that cookie auth is the fastest, token auth is a bit slower, basic auth is a lot slower.
With both cookie auth and token auth, I get responses "Password confirmation is required" on routes annotated with
@PasswordConfirmationRequired
every 30 minutes.The response json is like this:
In my code I am checking for
$data['ocs']['meta']['statuscode'] === 403 && $data['ocs']['meta']['message'] === "Password confirmation is required"
. If the check is positive, I clear the cookies and send another request.(I am using cookie auth, but the same would happen with token auth)
Problem
My check relies on a user interface string, which might change in future versions of Nextcloud.
Request
Send another special string with the response, that is more reliable to detect.
BUT
Don't remove any of the existing parts of the response, so not to break other clients.
OR
Make a commitment that the string "Password confirmation is required" is not going to change, ever.
The text was updated successfully, but these errors were encountered: