<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content

Okta Slack Provisioning Fails With a Long Username Error

Lifecycle Management
Okta Integration Network
Okta Classic Engine
Okta Identity Engine

Overview

Okta Slack provisioning fails when a user has a username exceeding the 21-character limit set by Slack. Resolve this issue by using a custom Okta expression to shorten the username or by manually updating the username to meet the character limit. The Slack provisioning flow fails, and Okta displays the following error in the 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

  • Okta Identity Engine (OIE)
  • Okta Classic Engine
  • Slack
  • Provisioning Error
  • Okta Expression Language (OEL)

Cause

The Slack username character limit is 21 characters. The error occurs because the Slack username of the user exceeds 21 characters.

Solution

How is the Slack long username provisioning error resolved?

Update the Slack Username attribute to reflect the 21-character limit if it appears in the attribute list. Resolve the error by using the following custom Okta expression to shorten the username to 21 characters or less.

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

Apply the expression to the application username format.

When authenticating Slack via Security Assertion Markup Language (SAML), apply the same expression to the application username format in the Sign-on settings to prevent the old username from overwriting the Slack Display Name attribute.

Advanced Sign-on Settings

NOTE: This expression fails if multiple users assigned to Slack have email addresses starting with the same 21 characters. Administrators must manually intervene to ensure uniqueness for these users.

 

Manually update the application username.

Alternatively, manually enter a unique Slack username of up to 21 characters, then retry the failed application assignment or provisioning task from the Tasks page.

 

Unassign and reassign the user.

If administrators prefer not to manually enter the username on the assignment, unassign the user, correct the profile, and reassign the user to Slack by performing the following steps.

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


Related References

Loading
Okta Slack Provisioning Fails With a Long Username Error | Okta Support