Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display AD Login Info Not Static String #46

Merged
merged 1 commit into from
Jun 27, 2018
Merged

Conversation

srvrguy
Copy link
Collaborator

@srvrguy srvrguy commented Jun 26, 2018

Rather than displaying the string “Azure AD” for all users with connections to AAD, set the “Provider Login” value to the Displayable ID from the AD info. Fixes the new requirement for a unique value in SonarQube 7.2 and makes it easier to see what AD account is associated with a specific SQ user.

Fixes #45

Rather than displaying the string “Azure AD” for all users with connections to AAD, set the “Provider Login” value to the Displayable ID from the AD info. Fixes the new requirement for a unique value in SonarQube 7.2 and makes it easier to see what AD account is associated with a specific SQ user.
@@ -127,7 +127,7 @@ public void callback(CallbackContext context) {

UserInfo aadUser = result.getUserInfo();
UserIdentity.Builder userIdentityBuilder = UserIdentity.builder()
.setProviderLogin(getName())
.setProviderLogin(aadUser.getDisplayableId())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR could also be a good opportunity to use the new API to define the provider ID (https://github.com/SonarSource/sonar-enterprise/blob/master/sonar-plugin-api/src/main/java/org/sonar/api/server/authentication/UserIdentity.java#L68), but using Sonarqube 7.2 dependency and adding :
.setProviderId(aadUser.getUniqueId())
(even if by doing that I understand that it will break compatibility of this plugin with previous version of SonarQube)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't personally think breaking compatibility with older versions is a bad thing, the older version of the plugin will continue to work with older versions of SQ.

I'd be very happy to see this plugin get enhancements like getting the group sync working, moving off the deprecated features in the 6.7 API (let alone to base on a newer API), etc. My fix was more just a quick patch to get a version that will work on 7.2 so I can have a successful upgrade and maybe other users can as well.

@hkamel hkamel merged commit eedb377 into hkamel:master Jun 27, 2018
@srvrguy srvrguy deleted the sonar72fix branch June 27, 2018 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants