Okta Application Assignment Fails With Blank Username Field Error
Last Updated:
Overview
Okta generates an application assignment error when the required attribute for the custom username lacks a value at the time of assignment. Resolve this issue by updating the user assignment, modifying group membership assignments, or modifying attribute mappings. When assigning a user to an application, the user assignment fails with an error visible under the Assignments tab of the application:
Blank is an invalid value for username field (code blank).
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Applications
- User Assignment
- Group Assignment
- Custom Attribute Username
Cause
The attribute required to generate the application username lacks a value at the exact time of user assignment to the application. For example, if an application has a custom username set on the Sign On tab, the attribute is required to generate the application username.
If the attribute lacks a value at the exact time of user assignment to the application, Okta generates the error.
If the username contains a value when checking later by opening the application user profile assignment, the error remains. This indicates that the attribute update occurred after the user was assigned to the application.
Solution
How is the assignment error resolved for individual users?
Resolve the error for individual users by updating their assignments on the Tasks page or the application assignment page.
- Check and resolve on an individual basis from the Dashboard > Tasks page by locating the error either by application or by user, editing the user assignment to a valid username, and selecting Save Assignment and Retry to complete the assignment and initiate provisioning.
- Update the application assignment for the affected user:
- For a user assigned to the application as an individual: Select Convert assignments, choose Select assignments to convert, and select Convert Selected.
- For a user assigned to the application through group membership: Select Edit User Assignment and choose Administrator (overrides group).
Override the group assignment by selecting the administrator option in the edit user assignment prompt.
Modifying group membership assignments prevents the assignment error.
Defer the normal flow of application assignments until the user meets all necessary attributes or conditions by leveraging the Okta group rules feature to create a group with memberships made up of only users who have the valid attribute populated.
- Create an Okta group rule to assign users to the application using a new or existing Okta group.
- Using Okta Expression Language, create a custom expression such as
user.attribute_name != '' AND user.attribute_name != null. Theattribute_nameis the variable that the application username format depends on. - Add any other conditions that determine application assignment eligibility to be compatible with Expressions in group rules.
- Activate the group rule and verify that the rule adds the expected users as members.
- Assign the group to the application.
How are attribute mappings modified to resolve the assignment error?
Map attributes to a custom Okta user attribute and use them to populate the application username by configuring user mappings in the Profile Editor.
- Go to Directory > Profile Editor.
- Under Filters, select Directories.
- Select Mappings > Configure User Mappings for the specific directory.
- Enter the attribute into an open Okta attribute field in the Domain to Okta mappings.
- Select Save Mappings.
- Navigate to the application Assignments tab.
- Select the Edit (pencil icon) button to edit the user and update the username.
- Select Save.
- Update the Application username format in the application Sign On tab to the new variable.
