nextcloud / nextcloud/server

Machine-detectable response code for "Password confirmation is required"

Open
#37,377 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage developer experience enhancement feature: authentication
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.
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:

{"ocs":{"meta":{"status":"failure","statuscode":403,"message":"Password confirmation is required","totalitems":"","itemsperpage":""},"data":[]}}

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the routes annotated with @PasswordConfirmationRequired and the code that builds their OCS response. Check how the existing 403 response is tested, then define a machine-detectable value while preserving the current response fields and wording for existing clients.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, authentication, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.