记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
d19a9ff0
Commit
d19a9ff0
authored
Jun 04, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix token;
parent
32e0cd59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
JwtValidator.java
...in/java/com/liquidnet/commons/lang/core/JwtValidator.java
+2
-4
No files found.
liquidnet-bus-common/liquidnet-common-base/src/main/java/com/liquidnet/commons/lang/core/JwtValidator.java
View file @
d19a9ff0
...
...
@@ -24,8 +24,6 @@ public class JwtValidator {
private
Long
refreshTtl
;
private
Long
blacklistGracePeriod
;
SecretKey
secretKey
=
new
SecretKeySpec
(
secret
.
getBytes
(),
SignatureAlgorithm
.
HS256
.
getJcaName
());
// private static final long EXPIRE_TIME = 15 * 60 * 1000;
// private static final String TOKEN_SECRET = "qZHglvNP0n0aOOckHiQXq5JMD468J4eG";
...
...
@@ -44,7 +42,7 @@ public class JwtValidator {
.
setClaims
(
claimsMap
)
.
setIssuedAt
(
new
Date
(
nowMillis
))
.
setExpiration
(
new
Date
(
expMillis
))
.
signWith
(
SignatureAlgorithm
.
HS256
,
secretKey
);
.
signWith
(
SignatureAlgorithm
.
HS256
,
new
SecretKeySpec
(
secret
.
getBytes
(),
SignatureAlgorithm
.
HS256
.
getJcaName
())
);
return
builder
.
compact
();
}
...
...
@@ -56,7 +54,7 @@ public class JwtValidator {
*/
public
Claims
parse
(
String
token
)
{
return
Jwts
.
parser
()
.
setSigningKey
(
secretKey
)
.
setSigningKey
(
new
SecretKeySpec
(
secret
.
getBytes
(),
SignatureAlgorithm
.
HS256
.
getJcaName
())
)
.
parseClaimsJws
(
token
).
getBody
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment