Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
b59e6aa3
Commit
b59e6aa3
authored
Mar 15, 2023
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cas修改
parent
7aaf5d78
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
7 deletions
+1
-7
PasswordDecoderFilter.java
...cloud/plus/v1/yifu/auth/filter/PasswordDecoderFilter.java
+1
-7
No files found.
yifu-auth/src/main/java/com/yifu/cloud/plus/v1/yifu/auth/filter/PasswordDecoderFilter.java
View file @
b59e6aa3
...
...
@@ -23,7 +23,6 @@ import org.springframework.web.client.RestTemplate;
import
javax.crypto.spec.IvParameterSpec
;
import
javax.crypto.spec.SecretKeySpec
;
import
javax.servlet.http.Cookie
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -57,20 +56,15 @@ public class PasswordDecoderFilter extends UsernamePasswordAuthenticationFilter
username
=
username
!=
null
?
username
:
""
;
username
=
username
.
trim
();
String
tgt
=
""
;
if
(
Common
.
isNotNull
(
result
))
{
try
{
for
(
Cookie
cookie
:
request
.
getCookies
())
{
tgt
=
cookie
.
getValue
();
break
;
}
RestTemplate
restTemplate
=
new
RestTemplate
();
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_FORM_URLENCODED
);
MultiValueMap
<
String
,
Object
>
wholeForm
=
new
LinkedMultiValueMap
<>();
wholeForm
.
add
(
"service"
,
CASproperties
.
CLIENT_LOGIN_PAGE
);
HttpEntity
<
MultiValueMap
<
String
,
Object
>>
entity
=
new
org
.
springframework
.
http
.
HttpEntity
<>(
wholeForm
,
headers
);
ResponseEntity
<
String
>
obj
=
restTemplate
.
exchange
(
CASproperties
.
SPRING_SECURITY_CAS_SERVER
+
"/"
+
tg
t
,
HttpMethod
.
POST
,
entity
,
String
.
class
);
ResponseEntity
<
String
>
obj
=
restTemplate
.
exchange
(
CASproperties
.
SPRING_SECURITY_CAS_SERVER
+
"/"
+
resul
t
,
HttpMethod
.
POST
,
entity
,
String
.
class
);
if
(
obj
.
getStatusCode
().
value
()
==
200
)
{
String
st
=
obj
.
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