com.healthy.common.security.authentication.mobile.MobileUser Maven / Gradle / Ivy
package com.healthy.common.security.authentication.mobile;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
import java.util.Collection;
/**
* Models core user information retrieved by a {@link MobileUserDetails}.
*
* Developers may use this class directly, subclass it, or write their own
* {@link MobileUserDetails} implementation from scratch.
*
*
* @author xiaomingzhang
*/
public class MobileUser extends User implements MobileUserDetails {
private static final long serialVersionUID = 1L;
private final String userMobile;
public MobileUser(String userMobile, String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection extends GrantedAuthority> authorities) {
super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
this.userMobile = userMobile;
}
public MobileUser(String userMobile, String username, String password, Collection extends GrantedAuthority> authorities) {
super(username, password, authorities);
this.userMobile = userMobile;
}
@Override
public String getUserMobile() {
return userMobile;
}
}