Improve login
[lgpl/argeo-commons.git] / org.argeo.security.core / src / org / argeo / security / NodeAuthenticationToken.java
index 4a802553b5050fbd5fe34fa123c11424137e126b..600811d75e09720199cf00a86f4f0b05680e82ed 100644 (file)
@@ -53,4 +53,17 @@ public class NodeAuthenticationToken extends
        public Boolean isRemote() {
                return url != null;
        }
+
+       public String toString() {
+               String username = getName();
+               StringBuilder buf = new StringBuilder("groups=");
+               for (GrantedAuthority ga : getAuthorities()) {
+                       if (!ga.getAuthority().equals(username)) {
+                               buf.append(ga.getAuthority());
+                               buf.append(',');
+                       }
+               }
+               buf.deleteCharAt(buf.length() - 1);
+               return "uid=" + getName() + " " + buf.toString();
+       }
 }