Skip to content

token认证存在bug #174

@drawwon

Description

@drawwon

user-service,user-provider项目中com.gpmall.user.utils.JwtTokenUtils#freeJwt,这个方法中:

//获得token的头部,载荷和签名,只对比头部和载荷
String[] headPayload = token.split("\\.");
 //获得jwt解密后头部
String header = decodedJWT.getHeader();
//获得jwt解密后载荷
String payload = decodedJWT.getPayload();
if (!header.equals(headPayload[0]) && !payload.equals(headPayload[1])) {
throw new ValidateException(SysRetCodeConstants.TOKEN_VALID_FAILED.getCode(), SysRetCodeConstants.TOKEN_VALID_FAILED.getMessage());
        }

其中header和payload都是解密之后的,而headPayload是解密之前的,这里是否存在逻辑错误,希望大家帮忙看看

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions