You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by mj...@apache.org on 2017/10/27 17:50:50 UTC

[06/24] incubator-guacamole-client git commit: GUACAMOLE-362: Fix case where credential object is null.

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


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/1c333106
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/1c333106
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/1c333106

Branch: refs/heads/staging/0.9.14-incubating
Commit: 1c333106c03a188418679e7e248a3e848dd604b7
Parents: 1c4831d
Author: Nick Couchman <vn...@apache.org>
Authored: Sat Aug 19 14:06:05 2017 -0400
Committer: Nick Couchman <ni...@yahoo.com>
Committed: Fri Oct 27 13:05:12 2017 -0400

----------------------------------------------------------------------
 .../guacamole/auth/cas/AuthenticationProviderService.java   | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/1c333106/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java b/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java
index 0422d30..6a13a83 100644
--- a/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java
+++ b/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java
@@ -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;
             }