Remove the Username Attribute from a Database Connection User Profile using the Management API

Overview

Users were incorrectly imported with a username attribute in the context of a database connection. The username attribute is not required for these user profiles. An error occurs when attempting to set the username attribute through the Management API to null or undefined

Applies To

  • Username attribute
  • Management API

Solution

It is not possible to remove the username attribute from a database connection user profile once the profile is set with one. This is independent of the connection being configured with requires username option or not. The validation rules in the Management API require that any value provided for the username property be a string with at least one character so this prevents any attempts to remove the attribute through Management API.

The self-service alternatives always imply the recreation of the user profile; if the connection is a custom database connection the user could be removed and the custom scripts updated to ensure that username is not returned on a subsequent login. If the connection is a custom database connection with import mode enabled the situation is more complex as removing the user may imply their current credentials (password) is lost if the user changed their password after they got migrated into the tenant.

It's technically possible to request an export of password hashes and re-import all the users (without the username) into a new connection, however, this will imply either a maintenance window where logins are unavailable (time it will take to delete the original connection and re-import the users into a new connection) or it will require importing users with different user identifiers.

Recommended content

No recommended content found...