public String getName() { if (this.getPrincipal() instanceof UserDetails) { return ((UserDetails) this.getPrincipal()).getUsername(); } if (this.getPrincipal() instanceof AuthenticatedPrincipal) { return ((AuthenticatedPrincipal) this.getPrincipal()).getName(); } if (this.getPrincipal() instanceof Principal) { return ((Principal) this.getPrincipal()).getName(); } return (this.getPrincipal() == null) ? "" : this.getPrincipal().toString(); }
public String getName() { if (this.getPrincipal() instanceof UserDetails) { return ((UserDetails) this.getPrincipal()).getUsername(); } if (this.getPrincipal() instanceof AuthenticatedPrincipal) { return ((AuthenticatedPrincipal) this.getPrincipal()).getName(); } if (this.getPrincipal() instanceof Principal) { return ((Principal) this.getPrincipal()).getName(); } return (this.getPrincipal() == null) ? "" : this.getPrincipal().toString(); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(super.toString()).append(": "); sb.append("Principal: ").append(this.getPrincipal()).append("; "); sb.append("Credentials: [PROTECTED]; "); sb.append("Authenticated: ").append(this.isAuthenticated()).append("; "); sb.append("Details: ").append(this.getDetails()).append("; "); if (!authorities.isEmpty()) { sb.append("Granted Authorities: "); int i = 0; for (GrantedAuthority authority : authorities) { if (i++ > 0) { sb.append(", "); } sb.append(authority); } } else { sb.append("Not granted any authorities"); } return sb.toString(); } }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(super.toString()).append(": "); sb.append("Principal: ").append(this.getPrincipal()).append("; "); sb.append("Credentials: [PROTECTED]; "); sb.append("Authenticated: ").append(this.isAuthenticated()).append("; "); sb.append("Details: ").append(this.getDetails()).append("; "); if (!authorities.isEmpty()) { sb.append("Granted Authorities: "); int i = 0; for (GrantedAuthority authority : authorities) { if (i++ > 0) { sb.append(", "); } sb.append(authority); } } else { sb.append("Not granted any authorities"); } return sb.toString(); } }
@Override public int hashCode() { int code = 31; for (GrantedAuthority authority : authorities) { code ^= authority.hashCode(); } if (this.getPrincipal() != null) { code ^= this.getPrincipal().hashCode(); } if (this.getCredentials() != null) { code ^= this.getCredentials().hashCode(); } if (this.getDetails() != null) { code ^= this.getDetails().hashCode(); } if (this.isAuthenticated()) { code ^= -37; } return code; }
@Override public int hashCode() { int code = 31; for (GrantedAuthority authority : authorities) { code ^= authority.hashCode(); } if (this.getPrincipal() != null) { code ^= this.getPrincipal().hashCode(); } if (this.getCredentials() != null) { code ^= this.getCredentials().hashCode(); } if (this.getDetails() != null) { code ^= this.getDetails().hashCode(); } if (this.isAuthenticated()) { code ^= -37; } return code; }
if (this.getPrincipal() == null && test.getPrincipal() != null) { return false; if (this.getPrincipal() != null && !this.getPrincipal().equals(test.getPrincipal())) { return false;
if (this.getPrincipal() == null && test.getPrincipal() != null) { return false; if (this.getPrincipal() != null && !this.getPrincipal().equals(test.getPrincipal())) { return false;
/** * Checks the {@code credentials}, {@code principal} and {@code details} objects, * invoking the {@code eraseCredentials} method on any which implement * {@link CredentialsContainer}. */ public void eraseCredentials() { eraseSecret(getCredentials()); eraseSecret(getPrincipal()); eraseSecret(details); }
/** * Checks the {@code credentials}, {@code principal} and {@code details} objects, * invoking the {@code eraseCredentials} method on any which implement * {@link CredentialsContainer}. */ public void eraseCredentials() { eraseSecret(getCredentials()); eraseSecret(getPrincipal()); eraseSecret(details); }
public String getName() { if (this.getPrincipal() instanceof UserDetails) { return ((UserDetails) this.getPrincipal()).getUsername(); } if (getPrincipal() instanceof Principal) { return ((Principal)getPrincipal()).getName(); } return (this.getPrincipal() == null) ? "" : this.getPrincipal().toString(); }
public String getName() { if (this.getPrincipal() instanceof UserDetails) { return ((UserDetails) this.getPrincipal()).getUsername(); } if (this.getPrincipal() instanceof AuthenticatedPrincipal) { return ((AuthenticatedPrincipal) this.getPrincipal()).getName(); } if (this.getPrincipal() instanceof Principal) { return ((Principal) this.getPrincipal()).getName(); } return (this.getPrincipal() == null) ? "" : this.getPrincipal().toString(); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(super.toString()).append(": "); sb.append("Principal: ").append(this.getPrincipal()).append("; "); sb.append("Credentials: [PROTECTED]; "); sb.append("Authenticated: ").append(this.isAuthenticated()).append("; "); sb.append("Details: ").append(this.getDetails()).append("; "); if (!authorities.isEmpty()) { sb.append("Granted Authorities: "); int i = 0; for (GrantedAuthority authority: authorities) { if (i++ > 0) { sb.append(", "); } sb.append(authority); } } else { sb.append("Not granted any authorities"); } return sb.toString(); } }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(super.toString()).append(": "); sb.append("Principal: ").append(this.getPrincipal()).append("; "); sb.append("Credentials: [PROTECTED]; "); sb.append("Authenticated: ").append(this.isAuthenticated()).append("; "); sb.append("Details: ").append(this.getDetails()).append("; "); if (!authorities.isEmpty()) { sb.append("Granted Authorities: "); int i = 0; for (GrantedAuthority authority : authorities) { if (i++ > 0) { sb.append(", "); } sb.append(authority); } } else { sb.append("Not granted any authorities"); } return sb.toString(); } }
@Override public int hashCode() { int code = 31; for (GrantedAuthority authority : authorities) { code ^= authority.hashCode(); } if (this.getPrincipal() != null) { code ^= this.getPrincipal().hashCode(); } if (this.getCredentials() != null) { code ^= this.getCredentials().hashCode(); } if (this.getDetails() != null) { code ^= this.getDetails().hashCode(); } if (this.isAuthenticated()) { code ^= -37; } return code; }
@Override public int hashCode() { int code = 31; for (GrantedAuthority authority : authorities) { code ^= authority.hashCode(); } if (this.getPrincipal() != null) { code ^= this.getPrincipal().hashCode(); } if (this.getCredentials() != null) { code ^= this.getCredentials().hashCode(); } if (this.getDetails() != null) { code ^= this.getDetails().hashCode(); } if (this.isAuthenticated()) { code ^= -37; } return code; }
if (this.getPrincipal() == null && test.getPrincipal() != null) { return false; if (this.getPrincipal() != null && !this.getPrincipal().equals(test.getPrincipal())) { return false;
if (this.getPrincipal() == null && test.getPrincipal() != null) { return false; if (this.getPrincipal() != null && !this.getPrincipal().equals(test.getPrincipal())) { return false;
/** * Checks the {@code credentials}, {@code principal} and {@code details} objects, * invoking the {@code eraseCredentials} method on any which implement * {@link CredentialsContainer}. */ public void eraseCredentials() { eraseSecret(getCredentials()); eraseSecret(getPrincipal()); eraseSecret(details); }
/** * Checks the {@code credentials}, {@code principal} and {@code details} objects, invoking the * {@code eraseCredentials} method on any which implement {@link CredentialsContainer}. */ public void eraseCredentials() { eraseSecret(getCredentials()); eraseSecret(getPrincipal()); eraseSecret(details); }