com.github.cobrijani.model.SimpleUserDetails Maven / Gradle / Ivy
package com.github.cobrijani.model;
import lombok.AllArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.Arrays;
import java.util.Collection;
/**
* Simple implementation of {@link UserDetails}
* Created by SBratic on 2/18/2017.
*/
@AllArgsConstructor
public class SimpleUserDetails implements UserDetails {
private String username;
private char[] password;
private Collection extends GrantedAuthority> authorities;
@Override
public Collection extends GrantedAuthority> getAuthorities() {
return authorities;
}
@Override
public String getPassword() {
return Arrays.toString(password);
}
@Override
public String getUsername() {
return username;
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return true;
}
}