GUACAMOLE-362: Fix case where credential object is null.

This commit is contained in:
Nick Couchman
2017-08-19 14:06:05 -04:00
committed by Nick Couchman
parent 1c4831dd51
commit 1c333106c0

View File

@@ -109,9 +109,12 @@ public class AuthenticationProviderService {
AttributePrincipal principal = ticketService.validateTicket(ticket);
String username = principal.getName();
credentials.setUsername(username);
String clearPass = decryptPassword(principal.getAttributes().get("credential").toString());
if (clearPass != null && !clearPass.isEmpty())
credentials.setPassword(clearPass);
Object credObj = principal.getAttributes().get("credential");
if (credObj != null) {
String clearPass = decryptPassword(credObj.toString());
if (clearPass != null && !clearPass.isEmpty())
credentials.setPassword(clearPass);
}
authenticatedUser.init(username, credentials);
return authenticatedUser;
}