Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
long-tern-care-service
Project
Project
Details
Activity
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
hubin
long-tern-care-service
Commits
9d7d1c65
Commit
9d7d1c65
authored
Mar 07, 2023
by
maqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取token解密失败问题
parent
5b82c8d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
AuthController.java
...main/java/com/hungraim/ltc/controller/AuthController.java
+6
-0
No files found.
auth-service/src/main/java/com/hungraim/ltc/controller/AuthController.java
View file @
9d7d1c65
...
...
@@ -3,6 +3,7 @@ package com.hungraim.ltc.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.hungraim.ltc.util.CsoftSecurityUtil
;
import
com.hungraim.ltc.util.Result
;
import
com.hungraim.ltc.util.ResultCode
;
import
lombok.AllArgsConstructor
;
import
lombok.SneakyThrows
;
import
org.springframework.data.redis.core.RedisTemplate
;
...
...
@@ -24,6 +25,8 @@ import java.util.Map;
@AllArgsConstructor
public
class
AuthController
{
final
static
String
FALSE
=
"false"
;
private
final
RedisTemplate
redisTemplate
;
private
final
TokenEndpoint
tokenEndpoint
;
...
...
@@ -31,6 +34,9 @@ public class AuthController {
@SneakyThrows
public
Result
<
OAuth2AccessToken
>
postAccessToken
(
Principal
principal
,
@RequestParam
Map
<
String
,
String
>
parameters
)
{
String
password
=
parameters
.
get
(
"password"
);
if
(
FALSE
.
equals
(
password
)){
return
Result
.
failed
(
ResultCode
.
USER_LOGIN_ERROR
);
}
String
decrypt
=
CsoftSecurityUtil
.
decryptRSADefault
(
password
);
parameters
.
put
(
"password"
,
decrypt
);
OAuth2AccessToken
oAuth2AccessToken
=
tokenEndpoint
.
postAccessToken
(
principal
,
parameters
).
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