602 Unstar Star 2K Fork 706

GVPbaomidou / kisso

3.7版本代码问题

Closed
WXD  Opened this issue

注意黑体字体,会导致前面设置的ip, issuer全部失效,此处是否应该改成this.jwtBuilder.addClaims(this.getClaims());?
还有Object data 在getToken()既没有存入,也没有parser()里面取出。比如如果我需要记录某个值如userId,是不是就不可以了? 这段逻辑是否落下了?

if (null != this.getIp()) {
    this.jwtBuilder.claim(SSOConstants.TOKEN_USER_IP, this.getIp());
}
if (null != this.getIssuer()) {
    this.jwtBuilder.setIssuer(this.getIssuer());
}
if (null != this.getUserAgent()) {
    this.jwtBuilder.claim(SSOConstants.TOKEN_USER_AGENT, this.getUserAgent());
}
if (null != this.getClaims()) {
     **this.jwtBuilder.setClaims(this.getClaims());** 
}
if (TokenFlag.NORMAL != this.getFlag()) {
    this.jwtBuilder.claim(SSOConstants.TOKEN_FLAG, this.getFlag().value());
}
12260 jobob 1578914833 total 2 participants

Comments (1)

12260 jobob 1578914833
青苗 2018-04-10 15:43 owner
JwtBuilder jwtBuilder = Jwts.builder();
jwtBuilder.claim(自定义属性, 自定义值);
SSOToken  token = SSOToken.create(jwtBuilder)
                    .setId(user.getId()).setIssuer(user.getUsername())
                    .setUserAgent(request);

Sign in to comment

Assignees
Labels
Not set
Projects
Milestones
Branches
Planed to start
Not set
Planed to end
Not set
Top level
Priority
Java
1
https://gitee.com/baomidou/kisso.git
git@gitee.com:baomidou/kisso.git
baomidou
kisso
kisso

Search

132457 8cb2edc1 1899542 131848 70c8d3a4 1899542