/** * Private Constructor to help in Jackson deserialization. * * @param keyHash hashCode of above given key. * @param principal the principal (typically a <code>UserDetails</code>) * @param authorities the authorities granted to the principal * @since 4.2 */ private RememberMeAuthenticationToken(Integer keyHash, Object principal, Collection<? extends GrantedAuthority> authorities) { super(authorities); this.keyHash = keyHash; this.principal = principal; setAuthenticated(true); }
/** * Private Constructor to help in Jackson deserialization. * * @param keyHash hashCode of above given key. * @param principal the principal (typically a <code>UserDetails</code>) * @param authorities the authorities granted to the principal * @since 4.2 */ private RememberMeAuthenticationToken(Integer keyHash, Object principal, Collection<? extends GrantedAuthority> authorities) { super(authorities); this.keyHash = keyHash; this.principal = principal; setAuthenticated(true); }
/** * Constructor. * * @param key to identify if this object made by an authorised client * @param principal the principal (typically a <code>UserDetails</code>) * @param authorities the authorities granted to the principal * @throws IllegalArgumentException if a <code>null</code> was passed */ public RememberMeAuthenticationToken(String key, Object principal, Collection<? extends GrantedAuthority> authorities) { super(authorities); if ((key == null) || ("".equals(key)) || (principal == null) || "".equals(principal)) { throw new IllegalArgumentException( "Cannot pass null or empty values to constructor"); } this.keyHash = key.hashCode(); this.principal = principal; setAuthenticated(true); }
/** * Constructor. * * @param key to identify if this object made by an authorised client * @param principal the principal (typically a <code>UserDetails</code>) * @param authorities the authorities granted to the principal * @throws IllegalArgumentException if a <code>null</code> was passed */ public RememberMeAuthenticationToken(String key, Object principal, Collection<? extends GrantedAuthority> authorities) { super(authorities); if ((key == null) || ("".equals(key)) || (principal == null) || "".equals(principal)) { throw new IllegalArgumentException( "Cannot pass null or empty values to constructor"); } this.keyHash = key.hashCode(); this.principal = principal; setAuthenticated(true); }
@Test public void testSetAuthenticatedIgnored() { RememberMeAuthenticationToken token = new RememberMeAuthenticationToken("key", "Test", ROLES_12); assertThat(token.isAuthenticated()).isTrue(); token.setAuthenticated(false); assertThat(!token.isAuthenticated()).isTrue(); } }
/** * Private Constructor to help in Jackson deserialization. * * @param keyHash hashCode of above given key. * @param principal the principal (typically a <code>UserDetails</code>) * @param authorities the authorities granted to the principal * @since 4.2 */ private RememberMeAuthenticationToken(Integer keyHash, Object principal, Collection<? extends GrantedAuthority> authorities) { super(authorities); this.keyHash = keyHash; this.principal = principal; setAuthenticated(true); }
/** * Constructor. * * @param key to identify if this object made by an authorised client * @param principal the principal (typically a <code>UserDetails</code>) * @param authorities the authorities granted to the principal * * @throws IllegalArgumentException if a <code>null</code> was passed */ public RememberMeAuthenticationToken(String key, Object principal, Collection<? extends GrantedAuthority> authorities) { super(authorities); if ((key == null) || ("".equals(key)) || (principal == null) || "".equals(principal)) { throw new IllegalArgumentException("Cannot pass null or empty values to constructor"); } this.keyHash = key.hashCode(); this.principal = principal; setAuthenticated(true); }
/** * Constructor. * * @param key to identify if this object made by an authorised client * @param principal the principal (typically a <code>UserDetails</code>) * @param authorities the authorities granted to the principal * @throws IllegalArgumentException if a <code>null</code> was passed */ public RememberMeAuthenticationToken(String key, Object principal, Collection<? extends GrantedAuthority> authorities) { super(authorities); if ((key == null) || ("".equals(key)) || (principal == null) || "".equals(principal)) { throw new IllegalArgumentException( "Cannot pass null or empty values to constructor"); } this.keyHash = key.hashCode(); this.principal = principal; setAuthenticated(true); }