Is there a workaround to allow spaces in the username? We use a reverse proxy to retrieve the login information for a user from their smartcard but since their username has a space in it sonarqube doesn't like it

  • SonarQube 7.5

  • Reverse Proxy Setup

  • Apache

  • We use a script to add users who have a common access card (smartcard) to the server by copying specific data from the smartcard and add them to a list of authorized users. We’ve noticed that SonarQube doesn’t allow any spaces in the login. For example, Doe.John David.123456789 (notice the space between John and David)

  • We have no way of accessing their smartcard and changing their login name to remove the space

  • What would be the workaround if we can’t make any changes to the smartcard? We’ve tried to add the user manually but again it won’t let us add any spaces in the login.

Please assist.

Hello @arm,

SQ-wise there is no way of handling spaces in username. It’s actually quite unusual to have any computing system allowing spaces in username.

How does your user authenticate on SQ? I understood that the script is to add users in SQ, but how do they authenticate? Are they just local users in SQ and type their credential directly, or are you guys using another authentication method?
If you use the SSO authentication for example, your proxy could actually have a function to replace spaces by underscore before forwarding the query to SQ. So it’s possible to not change anything internally, but simply adapt usernames before they reach SQ.

What do you think?

Hi,

in addition to Antoine’s response, might be helpful.
If you need to change the headers you may use the Apache mod_headers module.
I had a problem with the AD groups coming ‘;’ separated, but Sonarqube needs it ‘,’ separated.
See https://stackoverflow.com/q/49858159 for details and solution.

Gilbert