Skip to content
English
  • There are no suggestions because the search field is empty.

API Share Creation Fails When Password Contains Leading Zero

Original Question or Issue:

API-based share creation fails when the password includes a leading zero (e.g., 01234567). The system either rejects the password due to length requirements or removes the leading zero.


Environment:

  • Product - FileCloud Server
  • Version - 23.253
  • Platform - Any

Steps to Reproduce:

  • Configure FileCloud with a public share password policy (e.g., minimum length = 8).

  • Send an API request to create a share with a password containing a leading zero.

    • Example:

      {  "password": 01234567
      }
  • Observe the behavior:

    • The password is interpreted without the leading zero.

    • The request may fail due to password length mismatch.


Error or Log Message:

  • No explicit error message related to leading zero.

  • Symptoms include:

    • Password failing minimum length validation.

    • Share creation failure.

    • Password being shortened (e.g., 01234567 → 1234567).


Defect or Enhancement Number:

No JIRA assigned


Cause:

The password field in the API request is being treated as a numeric value instead of a string.

  • Numeric values automatically strip leading zeros.

  • This results in:

    • Reduced password length.

    • Failure to meet password policy requirements.


Resolution or Workaround:

Ensure the password is sent as a string in the API payload.

Correct Example:

{
 "password": "01234567"
}

Incorrect Example:

{
 "password": 01234567
}

Notes:

  • The issue is not caused by FileCloud but by how the API request is constructed externally.

  • Even if no recent changes were made, this can occur due to:

    • Updates in API clients or scripts

    • Changes in data serialization or formatting

  • Always validate data types when handling sensitive fields like passwords.