Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yujianwangzivayy
MaxKey
提交
9a63f379
MaxKey
项目概览
yujianwangzivayy
/
MaxKey
与 Fork 源项目一致
Fork自
MaxKey单点登录官方(MaxKeyTop) / MaxKey
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MaxKey
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
9a63f379
编写于
8月 06, 2022
作者:
M
MaxKey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update HttpSessionListenerAdapter.java cast Error
上级
dbd60a54
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
7 deletion
+23
-7
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/web/HttpSessionListenerAdapter.java
...java/org/maxkey/authn/web/HttpSessionListenerAdapter.java
+23
-7
未找到文件。
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/web/HttpSessionListenerAdapter.java
浏览文件 @
9a63f379
...
...
@@ -28,6 +28,7 @@ import org.maxkey.web.WebConstants;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.userdetails.User
;
@WebListener
public
class
HttpSessionListenerAdapter
implements
HttpSessionListener
{
...
...
@@ -53,20 +54,35 @@ public class HttpSessionListenerAdapter implements HttpSessionListener {
public
void
sessionDestroyed
(
HttpSessionEvent
sessionEvent
)
{
HttpSession
session
=
sessionEvent
.
getSession
();
Authentication
authentication
=
(
Authentication
)
session
.
getAttribute
(
WebConstants
.
AUTHENTICATION
);
SignPrincipal
principal
=
AuthorizationUtils
.
getPrincipal
(
authentication
);
if
(
principal
!=
null
&&
principal
.
getUserInfo
()
!=
null
)
{
_logger
.
debug
(
"{} HttpSession Id {} for userId {} , username {} @Ticket {} Destroyed"
,
Object
principal
=
authentication
==
null
?
null
:
authentication
.
getPrincipal
();
if
(
principal
!=
null
)
{
if
(
principal
instanceof
SignPrincipal
)
{
SignPrincipal
signPrincipal
=
(
SignPrincipal
)
principal
;
_logger
.
trace
(
"{} HttpSession Id {} for userId {} , username {} @Ticket {} Destroyed"
,
DateUtils
.
formatDateTime
(
new
Date
()),
session
.
getId
(),
signPrincipal
.
getUserInfo
().
getId
(),
signPrincipal
.
getUserInfo
().
getUsername
(),
signPrincipal
.
getSession
().
getId
());
}
else
if
(
principal
instanceof
User
)
{
User
user
=
(
User
)
principal
;
_logger
.
trace
(
"{} HttpSession Id {} for username {} password {} Destroyed"
,
DateUtils
.
formatDateTime
(
new
Date
()),
session
.
getId
(),
principal
.
getUserInfo
().
getId
(),
principal
.
getUserInfo
().
getUsername
(),
principal
.
getSession
().
getId
());
user
.
getUsername
(),
user
.
getPassword
());
}
else
{
_logger
.
trace
(
"{} HttpSession Id {} for principal {} Destroyed"
,
DateUtils
.
formatDateTime
(
new
Date
()),
session
.
getId
(),
principal
);
}
}
else
{
_logger
.
trace
(
"{} HttpSession Id {} Destroyed"
,
DateUtils
.
formatDateTime
(
new
Date
()),
session
.
getId
());
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录