@Override protected String getPassword(String username) { GenericPrincipal principal = principals.get(username); return principal == null ? null : principal.getPassword(); }
@Override public Principal authenticate(String username, String credentials) { GenericPrincipal principal = principals.get(username); boolean validated = principal != null && getCredentialHandler().matches(credentials, principal.getPassword()); return validated ? principal : null; }
/** * @return the password associated with the given principal's user name. */ @Override protected String getPassword(String username) { GenericPrincipal principal = principals.get(username); if (principal != null) { return principal.getPassword(); } else { return null; } }
/** * Return the password associated with the given principal's user name. */ protected String getPassword(String username) { GenericPrincipal principal = (GenericPrincipal) principals.get(username); if (principal != null) { return (principal.getPassword()); } else { return (null); } }
@Override protected String getPassword(String username) { GenericPrincipal principal = principals.get(username); return principal == null ? null : principal.getPassword(); }
/** * Return the password associated with the given principal's user name. */ @Override protected String getPassword(String username) { GenericPrincipal principal = principals.get(username); if (principal != null) { return (principal.getPassword()); } else { return (null); } }
/** * Return the password associated with the given principal's user name. */ @Override protected String getPassword(String username) { GenericPrincipal principal = principals.get(username); if (principal != null) { return (principal.getPassword()); } else { return (null); } }
/** * Return the password associated with the given principal's user name. */ @Override protected String getPassword(String username) { GenericPrincipal principal = principals.get(username); if (principal != null) { return (principal.getPassword()); } else { return (null); } }
/** * Return the password associated with the given principal's user name. */ @Override protected String getPassword(String username) { GenericPrincipal principal = principals.get(username); if (principal != null) { return (principal.getPassword()); } else { return (null); } }
@Override protected String getPassword(String username) { GenericPrincipal principal = principals.get(username); return principal == null ? null : principal.getPassword(); }
/** * Return the password associated with the given principal's user name. */ @Override protected String getPassword(String username) { GenericPrincipal principal = principals.get(username); if (principal != null) { return (principal.getPassword()); } else { return (null); } }
/** * Return the password associated with the given principal's user name. */ @Override protected String getPassword(String username) { GenericPrincipal principal = principals.get(username); if (principal != null) { return (principal.getPassword()); } else { return (null); } }
/** * @return the password associated with the given principal's user name. */ @Override protected String getPassword(String username) { GenericPrincipal principal = principals.get(username); if (principal != null) { return principal.getPassword(); } else { return null; } }
@Override protected String getPassword(String username) { GenericPrincipal principal = (GenericPrincipal) getPrincipal(username); if (principal == null) { return null; } else { return principal.getPassword(); } }
@Override protected String getPassword(String username) { GenericPrincipal principal = (GenericPrincipal) getPrincipal(username); if (principal == null) { return null; } else { return principal.getPassword(); } }
public static void writePrincipal(GenericPrincipal p, ObjectOutput out) throws IOException { out.writeUTF(p.getName()); out.writeBoolean(p.getPassword()!=null); if ( p.getPassword()!= null ) out.writeUTF(p.getPassword()); String[] roles = p.getRoles(); if ( roles == null ) roles = new String[0]; out.writeInt(roles.length); for ( int i=0; i<roles.length; i++ ) out.writeUTF(roles[i]); boolean hasUserPrincipal = (p != p.getUserPrincipal() && p.getUserPrincipal() instanceof Serializable); out.writeBoolean(hasUserPrincipal); if (hasUserPrincipal) out.writeObject(p.getUserPrincipal()); }
public static void writePrincipal(GenericPrincipal p, ObjectOutput out) throws IOException { out.writeUTF(p.getName()); out.writeBoolean(p.getPassword()!=null); if ( p.getPassword()!= null ) out.writeUTF(p.getPassword()); String[] roles = p.getRoles(); if ( roles == null ) roles = new String[0]; out.writeInt(roles.length); for ( int i=0; i<roles.length; i++ ) out.writeUTF(roles[i]); boolean hasUserPrincipal = (p != p.getUserPrincipal() && p.getUserPrincipal() instanceof Serializable); out.writeBoolean(hasUserPrincipal); if (hasUserPrincipal) out.writeObject(p.getUserPrincipal()); }
@Override public Principal authenticate(String username, String credentials) { GenericPrincipal principal = principals.get(username); boolean validated = false; if (principal != null && credentials != null) { if (hasMessageDigest()) { // Hex hashes should be compared case-insensitive validated = digest(credentials).equalsIgnoreCase(principal.getPassword()); } else { validated = digest(credentials).equals(principal.getPassword()); } } return validated ? principal : null; }
public static SerializablePrincipal createPrincipal(GenericPrincipal principal) { if ( principal==null) return null; return new SerializablePrincipal(principal.getName(), principal.getPassword(), principal.getRoles()!=null?Arrays.asList(principal.getRoles()):null, principal.getUserPrincipal()!=principal?principal.getUserPrincipal():null); }
public static SerializablePrincipal createPrincipal(GenericPrincipal principal) { if ( principal==null) return null; return new SerializablePrincipal(principal.getName(), principal.getPassword(), principal.getRoles()!=null?Arrays.asList(principal.getRoles()):null, principal.getUserPrincipal()!=principal?principal.getUserPrincipal():null); }