Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rs-cloud-platform
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
周健威
rs-cloud-platform
Commits
769b4aa0
Commit
769b4aa0
authored
Aug 22, 2024
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加数据中心验证代码
parent
53a367a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+10
-11
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
769b4aa0
...
...
@@ -72,9 +72,7 @@ public class AuthController {
if
(
requestType
==
null
||
requestType
.
trim
().
equals
(
""
))
{
requestType
=
RequestTypeConstants
.
BASE
;
}
final
String
token
;
String
name
=
""
;
String
token
=
null
;
OAuthService
service
=
(
OAuthService
)
request
.
getSession
().
getAttribute
(
"oauthv20service"
);
if
(
service
==
null
){
...
...
@@ -90,14 +88,15 @@ public class AuthController {
Token
EMPTY_TOKEN
=
null
;
Verifier
verifier
=
new
Verifier
(
request
.
getParameter
(
"code"
));
Token
accessTokeToken
=
service
.
getAccessToken
(
EMPTY_TOKEN
,
verifier
);
OAuthClient
restClient
=
new
OAuthClient
(
"https://gdxm.upyuns.com/sign/api/oauth/v20/me"
);
UserInfo
userInfo
=
restClient
.
getUserInfo
(
accessTokeToken
.
getAccess_token
());
JwtAuthenticationRequest
authenticationRequest
=
new
JwtAuthenticationRequest
(
userInfo
.
getUsername
(),
null
,
JwtAuthenticationRequest
.
CHECKPASS_NO
);
if
(
RequestTypeConstants
.
APP
.
equals
(
requestType
))
{
token
=
appAuthService
.
login
(
authenticationRequest
);
}
else
{
token
=
authService
.
login
(
authenticationRequest
);
if
(
accessTokeToken
.
getAccess_token
()
!=
null
)
{
OAuthClient
restClient
=
new
OAuthClient
(
"https://gdxm.upyuns.com/sign/api/oauth/v20/me"
);
UserInfo
userInfo
=
restClient
.
getUserInfo
(
accessTokeToken
.
getAccess_token
());
JwtAuthenticationRequest
authenticationRequest
=
new
JwtAuthenticationRequest
(
userInfo
.
getUsername
(),
null
,
JwtAuthenticationRequest
.
CHECKPASS_NO
);
if
(
RequestTypeConstants
.
APP
.
equals
(
requestType
))
{
token
=
appAuthService
.
login
(
authenticationRequest
);
}
else
{
token
=
authService
.
login
(
authenticationRequest
);
}
}
return
new
ObjectRestResponse
<
String
>().
data
(
token
);
}
...
...
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