package com.yuanchu.limslaboratory.shiro;
|
|
import com.yuanchu.limslaboratory.shiro.utils.JwtUtils;
|
import org.apache.shiro.authc.AuthenticationToken;
|
|
public class JwtToken implements AuthenticationToken {
|
private static final long serialVersionUID = 1L;
|
|
// 加密后的 JWT token串
|
private String token;
|
|
private String account;
|
|
public JwtToken(String token) {
|
this.token = token;
|
this.account = JwtUtils.getClaimFiled(token, "account");
|
}
|
|
@Override
|
public Object getPrincipal() {
|
return this.account;
|
}
|
|
@Override
|
public Object getCredentials() {
|
return token;
|
}
|
}
|