Skip to content

Remove required fields from user #4386

Description

@hifabienne

As an administrator, I want to be able to create users with only a username, making other fields like email, first name, and last name optional, so that I can accommodate diverse user onboarding scenarios and streamline the creation process.

Description

Currently, the user creation process requires several fields, such as email, first name, and last name, which can be restrictive in certain scenarios. This feature allows administrators to create users with only a username, making other fields optional. This provides flexibility for systems that don't require complete user profiles upon initial creation for example simplified onboarding flows. This change should be reflected across all user creation interfaces, including the self-registration UI, the management console UI, and the APIs.

Acceptance criteria

  • API User Creation:
    • Given: An API call to create a new user is made.
    • When: The API call only includes a username.
    • Then:
      • The user should be created successfully.
      • The response should indicate success.
      • The user's profile should contain the provided username.
      • The users display name is set to the username
    • When: The API call also includes optional fields such as email, firstname, lastname, email verified.
    • Then:
      • The user should be created successfully and the user profile should contain the provided optional fields.
      • The users display name should be set to either email or firstname + lastname
  • Management Console User Creation:
    • Given: An administrator is logged into the management console and navigates to the user creation page.
    • When: The administrator enters only a username and attempts to create the user.
    • Then:
      • The user should be created successfully.
      • The system should not display any validation errors related to missing optional fields (email, first name, last name, email verified).
      • The users display name shows the username
    • When: The administrator enters a username and any combination of the optional fields.
    • Then:
      • The user should be created successfully and the user profile should contain the provided optional fields.
      • The users display name shows either the username, email or firstname + lastname
  • Self-Registration UI (Login):
    • Given: A user attempts to register through the self-registration UI.
    • When: The user enters only a username and attempts to register.
    • Then:
      • The registration should be successful.
      • The system should not require the user to enter email, first name, or last name.
      • The users display name is taken to show the user, the display name contains the username
    • When: The user enters a username and any combination of the optional fields.
    • Then:
      • The user should be created successfully and the user profile should contain the provided optional fields.
      • The users display name is taken to show the user, the display name contains the username, the email address or firstname + lastname, dependent on the information the user has
  • Login without Verified Email:
    • Given: A user has been created with a username and an unverified email address or no email address at all.
    • When: The user attempts to log in using their username and password.
    • Then: The login should be successful.
  • Password Reset via Email:
    • Given: A user attempts to reset their password using the "Forgot Password" flow, which relies on email.
    • When: The user has no email address or an unverified email address associated with their account.
    • Then: The system should display an error message indicating that no contact information is available for password reset.
  •  Data Validation:
    • Given: A user creation attempt is made through any interface (API, management console, self-registration).
      • When: The username field is empty.
      • Then: The system should display a validation error indicating that the username is required.
    • Given: A user creation attempt is made through any interface.
      • When: The username field is not unique.
      • Then: The system should display a validation error indicating that the username already exists.
  • Documentation
    • The documentation is updated to reflect the new optional field behaviour for user creation

Technical Considerations

  • Implementation for hosted login v2 only
  • Hosted Login v1 will be removed
  • Existing v1 APIs will stay as is
  • API v2 will change --> make sure all customers are aware of this behaviour change

Metadata

Metadata

Labels

area/apiServer-side API — Go services, gRPC/Connect, command/queryarea/loginV2Login UI v2 (TypeScript / Next.js)service-layer

Type

No type

Fields

Priority

Medium

Projects

Status
To be scoped and estimated
Status
No status
Status
Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions