New user created with random numbers at the end of username

Hi SonarQube community,

  • SonarQube Version 8.7.1 (build 42226)
  • What are you trying to achieve:
    Create new users without any random numbers at the end of the username

I was using SonarQube 7.9.5 and everything was working great, all the new users were properly created with the same name and login.
But after upgrading to 8.7.1, when an user login for the first time and that account is created, 5 random numbers are added to the end of the login field:

image

The login way (external_identity_provider) we are using is SAML.
Is there a reason this is happening, and a way to avoid those random numbers at the end of the login field?
Thank you very much!
Greetings, Cristian.

Hi guys, do you have any info about this issue?
Thanks you very much again :slight_smile:
Greetings, Cristian.

Hello @cristian_lazaro ,

First of all welcome to the community!

This behaviour is expected with the change we have introduced here: https://jira.sonarsource.com/browse/SONAR-12475 .

Unfortunately there is no way to prevent that, this is a default behaviour when users are authenticated with external systems.

Could you explain what exactly problem it is causing on your side?

Cheers,
Jacek

The implementation needs urgent adjustment.

Passing the username is the name that is supplied by the identity provider. eg for Azure AD that will be the login the user has on the domain, which is also usually the primary SCM/RCS login name.

So instead this random user name appears which the user has no clue of, the help desk can’t find it in the Active Directory and more than that it is automatically added to the list of SCM accounts (why?).

Worse however is that the actual supplied login (the user’s actual domain login) is not added to the SCM account list (only the irrelevant invented one plus their email). So then blame doesn’t work unless somebody adds it manually.

It’s a poor implementation and needs a fix. At least allow us to pass an attribute that switches off this behaviour and use the supplied ‘login’ as intended; which is also added to the SCM account list so no follow-up activity is needed.

3 Likes

Hi All
We were running an old SonarQube version (6.7) until November 2021. And a lot of users existing which are created with there e-mail addresses. Since the update to 8.9.2, new users have this adjusted username with “-” instead of “.” or “@” and at the end an random number.
I thought this change do not harm me. But it dose. Some of the old user can’t login anymore. The message is like “This account is already associated with another authentication method.” But we did not change this method and some people can still login.
The only way to solve at the moment is to delete the existing user. Or is there an other way?
Greetings Rapha

Is there any specific reason for adding random numbers at the end of the login name when using SAML also is there any latest update on this like any plans to change this in near future etc?

Hi,

Same “issue” here. We are using LDAP authentication.

We have some automation and all the API is based on the ‘login’ field which is random (specially annoying when you have staging environment and a same user share a different ‘login’ field).

I found that the API api/users/update_login?login=<old login>&newLogin=<new login> can be used for external users has well. But is not convenient at all to have some automation to fix those login when they can be automatically matched with the external identity.

An other solution would be to update the API to allow selecting a user with ‘externalIdentity’ field.

Regards,

Hi,

I also faced the same issue hence I tried another SAML plugin from miniOrange. They have a sort of workaround in the plugin which worked for me. I suppose they alter the login value after user is created to maintain the configuration.

Regards,
Chris.

1 Like