Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
loginservice
Overview
Overview
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
lanmw
loginservice
Commits
76de4ec6
Commit
76de4ec6
authored
Apr 06, 2021
by
huangkp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ad认证
parent
33944ab7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
15 deletions
+22
-15
SSOCtrl.java
src/main/java/com/keymobile/proxy/api/SSOCtrl.java
+3
-3
ServiceInfo.java
src/main/java/com/keymobile/proxy/api/ServiceInfo.java
+3
-3
SecurityConfig.java
src/main/java/com/keymobile/proxy/conf/SecurityConfig.java
+5
-5
application-local.yml
src/main/resources/application-local.yml
+9
-3
bootstrap.yml
src/main/resources/bootstrap.yml
+2
-1
No files found.
src/main/java/com/keymobile/proxy/api/SSOCtrl.java
View file @
76de4ec6
...
@@ -19,14 +19,14 @@ public class SSOCtrl {
...
@@ -19,14 +19,14 @@ public class SSOCtrl {
// @Value("${sso.url}")
// @Value("${sso.url}")
// private String ssoUrl;
// private String ssoUrl;
@Value
(
"${redirect-url.
data-platform
}"
)
@Value
(
"${redirect-url.
indicator
}"
)
private
String
dataPlatformURL
;
private
String
indicatorUrl
;
@GetMapping
(
"/go"
)
@GetMapping
(
"/go"
)
public
String
doJump
(
Map
<
String
,
Object
>
model
)
{
public
String
doJump
(
Map
<
String
,
Object
>
model
)
{
model
.
put
(
"success"
,
true
);
model
.
put
(
"success"
,
true
);
model
.
put
(
"redirect-url"
,
dataPlatformURL
);
model
.
put
(
"redirect-url"
,
indicatorUrl
);
model
.
put
(
"msg"
,
"验证成功"
);
model
.
put
(
"msg"
,
"验证成功"
);
return
"main"
;
return
"main"
;
}
}
...
...
src/main/java/com/keymobile/proxy/api/ServiceInfo.java
View file @
76de4ec6
...
@@ -17,8 +17,8 @@ public class ServiceInfo {
...
@@ -17,8 +17,8 @@ public class ServiceInfo {
@Value
(
"${server.port}"
)
@Value
(
"${server.port}"
)
private
int
port
;
private
int
port
;
@Value
(
"${redirect-url.
system-management
}"
)
@Value
(
"${redirect-url.
indicator
}"
)
private
String
managementSystem
Url
;
private
String
indicator
Url
;
@RequestMapping
(
value
=
"/port"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/port"
,
method
=
RequestMethod
.
GET
)
public
Integer
getPort
()
{
public
Integer
getPort
()
{
...
@@ -49,7 +49,7 @@ public class ServiceInfo {
...
@@ -49,7 +49,7 @@ public class ServiceInfo {
@GetMapping
(
"/manager-url"
)
@GetMapping
(
"/manager-url"
)
public
String
getManagementSystemUrl
(
HttpServletResponse
response
)
{
public
String
getManagementSystemUrl
(
HttpServletResponse
response
)
{
response
.
setContentType
(
"text/plain;charset=utf-8"
);
response
.
setContentType
(
"text/plain;charset=utf-8"
);
return
managementSystem
Url
;
return
indicator
Url
;
}
}
}
}
src/main/java/com/keymobile/proxy/conf/SecurityConfig.java
View file @
76de4ec6
...
@@ -110,7 +110,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -110,7 +110,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
String
key
=
httpServletRequest
.
getParameter
(
"key"
);
String
key
=
httpServletRequest
.
getParameter
(
"key"
);
if
(
null
==
username
||
null
==
portal_password
||
if
(
null
==
username
||
null
==
portal_password
||
null
==
CallBack
||
null
==
key
){
null
==
CallBack
||
null
==
key
){
httpServletResponse
.
sendError
(
5
00
,
"sso login url missing request param"
);
httpServletResponse
.
sendError
(
2
00
,
"sso login url missing request param"
);
return
null
;
return
null
;
}
}
if
(
authAdLogin
)
{
if
(
authAdLogin
)
{
...
@@ -118,7 +118,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -118,7 +118,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
String
pwd
=
des
.
strDec
(
portal_password
,
key
);
String
pwd
=
des
.
strDec
(
portal_password
,
key
);
logger
.
info
(
"sso login param->userName:"
+
username
+
" pwd:"
+
pwd
);
logger
.
info
(
"sso login param->userName:"
+
username
+
" pwd:"
+
pwd
);
if
(!
authenticate
(
username
,
pwd
)){
if
(!
authenticate
(
username
,
pwd
)){
httpServletResponse
.
sendError
(
5
00
,
CallBack
+
"({'query':{'results':{'postresult':'portal_ssologin_fali'}}});"
);
httpServletResponse
.
sendError
(
2
00
,
CallBack
+
"({'query':{'results':{'postresult':'portal_ssologin_fali'}}});"
);
return
null
;
return
null
;
}
}
}
}
...
@@ -126,13 +126,13 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -126,13 +126,13 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
com
.
keymobile
.
proxy
.
model
.
User
user
=
portalService
.
getUserByUserId
(
username
);
com
.
keymobile
.
proxy
.
model
.
User
user
=
portalService
.
getUserByUserId
(
username
);
if
(
user
==
null
)
{
if
(
user
==
null
)
{
logger
.
error
(
username
+
" is not exit"
);
logger
.
error
(
username
+
" is not exit"
);
httpServletResponse
.
sendError
(
5
00
,
CallBack
+
"({'query':{'results':{'postresult':'portal_ssologin_fali'}}});"
);
httpServletResponse
.
sendError
(
2
00
,
CallBack
+
"({'query':{'results':{'postresult':'portal_ssologin_fali'}}});"
);
return
null
;
return
null
;
}
}
if
(!
authAdLogin
)
{
if
(!
authAdLogin
)
{
if
(!
StringUtils
.
equals
(
user
.
getPassword
(),
portal_password
))
{
if
(!
StringUtils
.
equals
(
user
.
getPassword
(),
portal_password
))
{
logger
.
error
(
username
+
" password:"
+
portal_password
+
" is error"
);
logger
.
error
(
username
+
" password:"
+
portal_password
+
" is error"
);
httpServletResponse
.
sendError
(
5
00
,
CallBack
+
"({'query':{'results':{'postresult':'portal_ssologin_fali'}}});"
);
httpServletResponse
.
sendError
(
2
00
,
CallBack
+
"({'query':{'results':{'postresult':'portal_ssologin_fali'}}});"
);
return
null
;
return
null
;
}
}
}
}
...
@@ -145,7 +145,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -145,7 +145,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
authorities
.
add
(
authorityInfo
);
authorities
.
add
(
authorityInfo
);
}
}
}
}
return
new
UsernamePasswordAuthenticationToken
(
new
User
(
userName
,
"whatever"
,
authorities
),
null
,
authorities
);
return
new
UsernamePasswordAuthenticationToken
(
new
User
(
userName
,
user
.
getPassword
()
,
authorities
),
null
,
authorities
);
}
}
};
};
authenticationFilter
.
setAuthenticationManager
(
authenticationManager
());
authenticationFilter
.
setAuthenticationManager
(
authenticationManager
());
...
...
src/main/resources/application-local.yml
View file @
76de4ec6
...
@@ -47,5 +47,11 @@ logging:
...
@@ -47,5 +47,11 @@ logging:
config
:
classpath:logback-custom.xml
config
:
classpath:logback-custom.xml
redirect-url
:
redirect-url
:
system-management
:
http://192.168.0.216:9090/center-home/view/index
indicator
:
http://139.198.127.54:18580/hndb/view/index
data-platform
:
http://192.168.0.216:9090/center-home/view/index
\ No newline at end of file
ad-authenticate
:
domain
:
hntobacco.com
provider-url
:
ldap://hntobacco.com:389
auth-login
:
adAuth
:
false
\ No newline at end of file
src/main/resources/bootstrap.yml
View file @
76de4ec6
...
@@ -2,7 +2,7 @@ spring:
...
@@ -2,7 +2,7 @@ spring:
application
:
application
:
name
:
auth
name
:
auth
profiles
:
profiles
:
active
:
test
active
:
local
# cloud:
# cloud:
# config:
# config:
# uri: http://localhost:8082
# uri: http://localhost:8082
\ No newline at end of file
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