Slack Provisioning Error "{"Errors":{"description":"long_username (user=<user>)","code":400}}"
Lifecycle Management
Okta Integration Network
Okta Classic Engine
Okta Identity Engine
Overview

Slack provisioning flow fails with the following error visible in the Okta dashboard:

Automatic provisioning of user <user> to app Slack failed: Error while trying to push profile update for <user>: Errors during execution: Error executing pushUserProfile: Bad Request. Errors reported by the connector : {"Errors":{"description":"long_username (user=<user>)","code":400}}. Error Code: null.

Applies To
  • Slack
  • Provisioning Error
  • Okta Expression Language (OEL)
Cause
The character limit is 21 characters for the Slack username on the Slack side. The user's Slack username is over 21 characters.
Solution

Use a custom Okta expression that shortens the username to 21 characters or less. If the "Slack Username" is seen in the attribute list, this will need to be updated to reflect the same 21-character limit.


For example:

String.len(String.substringBefore(user.email, "@")) > 21 ? String.substring(String.substringBefore(user.email, "@"),0,21) : String.substringBefore(user.email, "@")


If authenticating Slack via SAML, it may also be necessary to apply this same expression to the Application username format in the Sign-on settings to avoid the Slack Display Name attribute being overwritten by the old 22+ character username.
 

Advanced Sign-on Settings

NOTE: This expression will not work if multiple users are assigned to Slack whose email addresses start with the same 21 characters. Manual intervention will be required to ensure uniqueness for these users.


Please try manually entering the app username to a unique Slack username of a maximum of 21 characters and retry the failed app assignment/provisioning task from the Tasks page. 

Edit user assignment 


If the above method is not preferred, please perform the following: 

  1. Unassign the user from the application temporarily.
  2. Ensure the username correction is within the user profile.
  3. Reassign the user to Slack for a profile creation push downstream.


Related References

Recommended content

No recommended content found...