Problem

Users that contain specific special characters (# as an example) in the username will not be able to create any content in Confluence.

Special characters are not allowed in Confluence usernames as those users will not be able to create content, like spaces, but these user accounts can still be synchronized to Confluence via an external directory (please have a look at https://confluence.atlassian.com/doc/add-and-invite-users-138313.html).

Solution

Based on your user provisioning, there are different solutions.

Manual user provisioning

This will only work for Jira.

Edit the username to not contain any special characters (User management → Users → Actions → Edit Details)

User provisioning with User Sync / Just in Time Provisioning

If you are using our plugin User Sync (also part of our SAML Single Sign On plugin) a username rename, in your Atlassian User Management → Users → Actions → Edit Details would not help. Because the next sync would overwrite the username-rename and the username would contain special character again.

a. Recommended solution, if possible, change the Username on your Identity Provider (IdP). After you changed the username on your IdP (no special character anymore), the next sync will update the username and from now on the user can create any content in Confluence.

b. If not possible, create a SAML SSO Attribute Mapping to change the username. Please note that you also need to select a User Update Method, thereby User are updated during login.

  • Go to: SAML Single Sign On Configuration → Identity Providers →User Creation and Update


Add_attribute_mapping

In our example, we are using the following transformation:

Configuration: Replace (.*)[_#',*](.*) with "$1$2"

Test Input: "Nota'User@example.com"

Output: "NotaUser@example.com"
CODE


You need to modify the replace regex if the username contains other special character than '_,#,*'.