Skip to content

CLI accepts flag-like values for --single-user-name without warning #103

@melvincarvalho

Description

@melvincarvalho

Description

When running JSS with --single-user-name followed directly by another flag (like --idp), the CLI silently accepts the flag as the username value instead of warning or erroring.

Steps to Reproduce

jss start --single-user-name --idp --idp-issuer https://example.com/

Expected Behavior

The CLI should either:

  1. Error with a message like: Error: --single-user-name requires a value
  2. Or warn: Warning: username "--idp" looks like a flag. Did you forget to provide a value?

Actual Behavior

  • JSS silently uses --idp as the username
  • The --idp flag is not recognized as enabling the identity provider
  • The OIDC endpoints (/.well-known/openid-configuration) return 404
  • Users see confusing errors like: Dynamic Registration could not be completed because the issuer has no registration endpoint

The startup message shows:

Single-user: --idp (registration disabled)

...indicating --idp was interpreted as the username, not as a flag.

Suggested Fix

Add validation in the CLI argument parsing:

if (username && username.startsWith('--')) {
  console.error(`Error: --single-user-name value "${username}" looks like a flag.`);
  console.error('Did you forget to provide a username? Example: --single-user-name melvin');
  process.exit(1);
}

Environment

  • JSS version: 0.0.79
  • Node.js: v22.21.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions