Skip to content

Commit

Permalink
Bypass VM login attempt if SSO is not configured
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Kvist committed Dec 19, 2024
1 parent 89b2cd1 commit 78b61df
Showing 1 changed file with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,19 @@ protected void perform() {
final DbUser currentUser = getCurrentUser();
final String password = SsoUtils.getPassword(
sessionDataContainer.getSsoAccessToken(getParameters().getSessionId()));
final String domainController = currentUser != null ? currentUser.getDomain() : "";
final boolean sentToVM = runVdsCommand(
VDSCommandType.VmLogon,
new VmLogonVDSCommandParameters(
getVdsId(),
getVm().getId(),
domainController,
getUserName(),
password)).getSucceeded();
setSucceeded(sentToVM);
if (password == null) {
setSucceeded(true);
} else {
final String domainController = currentUser != null ? currentUser.getDomain() : "";
final boolean sentToVM = runVdsCommand(
VDSCommandType.VmLogon,
new VmLogonVDSCommandParameters(
getVdsId(),
getVm().getId(),
domainController,
getUserName(),
password)).getSucceeded();
setSucceeded(sentToVM);
}
}
}

0 comments on commit 78b61df

Please sign in to comment.