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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.

.setLogin(getLogin(aadUser))
.setName(aadUser.getGivenName() + " " + aadUser.getFamilyName())
.setEmail(aadUser.getDisplayableId());
Expand Down