Just stood up a brand new SonarQube 6.7.1 server and configured it to authenticate users via the LDAP plugin (2.2 build 608). So far so good.
However, when users trying to run a command line scan using maven with a token:
mvn sonar:sonar -Dsonar.login=438fd33be6d6e5c9146c674717fea4675f0eb
...they get the following error:
Not authorized. Please check the properties sonar.login and sonar.password.
The Sonar logs are showing:
2018.01.19 18:20:14 DEBUG web[AWELLmgpg7dbJTF2AALW][o.s.p.l.LdapUsersProvider] User 438fd33be6d6e5c9146c674717fea4675f0eb not found in <default>
2018.01.19 18:20:14 DEBUG web[AWELLmgpg7dbJTF2AALW][auth.event] login failure [cause|No user details][method|BASIC][provider|REALM|LDAP]
This makes it look like Sonar's LDAP plugin is attempting to look up a user on LDAP whose name would be the access token. Clearly this isn't going to work!
We are using sonar maven plugin version 3.4.0.905.
Edit: The same token works from IntelliJ SonarLint. Which seems to point to the Maven plugin being at fault here.
sonar.password
parameter with any value? – Subternaturalmvn help:evaluate -Dexpression="sonar.login"
andmvn help:evaluate -Dexpression="sonar.password"
. Off course add also all parameters which you are appended tomvn sonar:sonar
. – Subternatural