Last active
May 1, 2018 20:32
-
-
Save lusabo/a50c280035ef9801b640f58282807ee5 to your computer and use it in GitHub Desktop.
JwtUser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.eco.security; | |
// Imports | |
public class JwtUser implements UserDetails { | |
private Long id; | |
private String username; | |
private String password; | |
private Collection<? extends GrantedAuthority> authorities; | |
public JwtUser(Long id, String username, String password, Collection<? extends GrantedAuthority> authorities) { | |
this.id = id; | |
this.username = username; | |
this.password = password; | |
this.authorities = authorities; | |
} | |
public Long getId() { | |
return id; | |
} | |
@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 String getPassword() { | |
return password; | |
} | |
@Override | |
public Collection<? extends GrantedAuthority> getAuthorities() { | |
return authorities; | |
} | |
@Override | |
public boolean isEnabled() { | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment