Commit f7f0a1c2 by 袁伟铭

修改token认证获取

parent 26717455
...@@ -89,10 +89,7 @@ public class TokenProvider implements InitializingBean { ...@@ -89,10 +89,7 @@ public class TokenProvider implements InitializingBean {
} }
public Authentication getAuthentication(String token) { public Authentication getAuthentication(String token) {
Claims claims = Jwts.parser() Claims claims = getClaims(token);
.setSigningKey(DatatypeConverter.parseBase64Binary(properties.getBase64Secret()))
.parseClaimsJws(token)
.getBody();
// fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException // fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException
Object authoritiesStr = claims.get(AUTHORITIES_KEY); Object authoritiesStr = claims.get(AUTHORITIES_KEY);
......
...@@ -89,10 +89,7 @@ public class TokenProvider implements InitializingBean { ...@@ -89,10 +89,7 @@ public class TokenProvider implements InitializingBean {
} }
public Authentication getAuthentication(String token) { public Authentication getAuthentication(String token) {
Claims claims = Jwts.parser() Claims claims = getClaims(token);
.setSigningKey(DatatypeConverter.parseBase64Binary(properties.getBase64Secret()))
.parseClaimsJws(token)
.getBody();
// fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException // fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException
Object authoritiesStr = claims.get(AUTHORITIES_KEY); Object authoritiesStr = claims.get(AUTHORITIES_KEY);
......
...@@ -89,10 +89,7 @@ public class TokenProvider implements InitializingBean { ...@@ -89,10 +89,7 @@ public class TokenProvider implements InitializingBean {
} }
public Authentication getAuthentication(String token) { public Authentication getAuthentication(String token) {
Claims claims = Jwts.parser() Claims claims = getClaims(token);
.setSigningKey(DatatypeConverter.parseBase64Binary(properties.getBase64Secret()))
.parseClaimsJws(token)
.getBody();
// fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException // fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException
Object authoritiesStr = claims.get(AUTHORITIES_KEY); Object authoritiesStr = claims.get(AUTHORITIES_KEY);
......
...@@ -89,10 +89,7 @@ public class TokenProvider implements InitializingBean { ...@@ -89,10 +89,7 @@ public class TokenProvider implements InitializingBean {
} }
public Authentication getAuthentication(String token) { public Authentication getAuthentication(String token) {
Claims claims = Jwts.parser() Claims claims = getClaims(token);
.setSigningKey(DatatypeConverter.parseBase64Binary(properties.getBase64Secret()))
.parseClaimsJws(token)
.getBody();
// fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException // fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException
Object authoritiesStr = claims.get(AUTHORITIES_KEY); Object authoritiesStr = claims.get(AUTHORITIES_KEY);
......
...@@ -91,10 +91,7 @@ public class TokenProvider implements InitializingBean { ...@@ -91,10 +91,7 @@ public class TokenProvider implements InitializingBean {
} }
public Authentication getAuthentication(String token) { public Authentication getAuthentication(String token) {
Claims claims = Jwts.parser() Claims claims = getClaims(token);
.setSigningKey(DatatypeConverter.parseBase64Binary(properties.getBase64Secret()))
.parseClaimsJws(token)
.getBody();
// fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException // fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException
Object authoritiesStr = claims.get(AUTHORITIES_KEY); Object authoritiesStr = claims.get(AUTHORITIES_KEY);
......
...@@ -89,10 +89,7 @@ public class TokenProvider implements InitializingBean { ...@@ -89,10 +89,7 @@ public class TokenProvider implements InitializingBean {
} }
public Authentication getAuthentication(String token) { public Authentication getAuthentication(String token) {
Claims claims = Jwts.parser() Claims claims = getClaims(token);
.setSigningKey(DatatypeConverter.parseBase64Binary(properties.getBase64Secret()))
.parseClaimsJws(token)
.getBody();
// fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException // fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException
Object authoritiesStr = claims.get(AUTHORITIES_KEY); Object authoritiesStr = claims.get(AUTHORITIES_KEY);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment