我在Wildfly 10上部署了一个应用程序,它在GlassFish上正常运行,但是当我尝试登录时,我得到一个空白页面/<context_path>/j_security_check
。
我看过一些建议包含缓存控制请求标头的帖子,但它没有解决问题。
日志不会显示任何错误或相关信息,我真的不知道接下来要尝试什么。
有没有人遇到过类似的问题?
编辑1 身份验证工作正常。如果,之后,我尝试访问受保护的资源,我能够这样做。这只是登录后没有被触发的重定向。
编辑2 请求/响应转储:
----------------------------REQUEST---------------------------
URI=/ecc
characterEncoding=null
contentLength=-1
contentType=null
cookie=EPMSID=sfTmDLw92HjAhwfY7HUei5fzlUbwKjxUg3EhyTMk.d014349
header=Accept=text/html, application/xhtml+xml, */*
header=Connection=Keep-Alive
header=Accept-Language=pt-PT
header=Accept-Encoding=gzip, deflate
header=Cookie=EPMSID=sfTmDLw92HjAhwfY7HUei5fzlUbwKjxUg3EhyTMk.d014349
header=User-Agent=Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
header=Host=localhost:8443
locale=[pt_PT]
method=GET
protocol=HTTP/1.1
queryString=
remoteAddr=/127.0.0.1:62990
remoteHost=sibshare
scheme=https
host=localhost:8443
serverPort=8443
--------------------------RESPONSE--------------------------
contentLength=0
contentType=null
header=Connection=keep-alive
header=X-Powered-By=Undertow/1
header=Server=WildFly/10
header=Location=https://localhost:8443/ecc/
header=Content-Length=0
header=Date=Mon, 09 May 2016 08:18:33 GMT
status=302
==============================================================
2016-05-09 09:18:33,890 INFO [stdout] (default task-5) [DEBUG] ecc_src - NoCacheFilter:Initializing filter
2016-05-09 09:18:33,902 INFO [io.undertow.request.dump] (default task-5)
----------------------------REQUEST---------------------------
URI=/ecc/
characterEncoding=null
contentLength=-1
contentType=null
cookie=EPMSID=sfTmDLw92HjAhwfY7HUei5fzlUbwKjxUg3EhyTMk.d014349
header=Accept=text/html, application/xhtml+xml, */*
header=Connection=Keep-Alive
header=Accept-Language=pt-PT
header=Accept-Encoding=gzip, deflate
header=Cookie=EPMSID=sfTmDLw92HjAhwfY7HUei5fzlUbwKjxUg3EhyTMk.d014349
header=User-Agent=Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
header=Host=localhost:8443
locale=[pt_PT]
method=GET
protocol=HTTP/1.1
queryString=
remoteAddr=/127.0.0.1:62989
remoteHost=sibshare
scheme=https
host=localhost:8443
serverPort=8443
--------------------------RESPONSE--------------------------
contentLength=239
contentType=text/html
header=Expires=Thu, 01 Jan 1970 00:00:00 GMT
header=Cache-Control=no-cache, no-store, must-revalidate
header=X-Powered-By=Undertow/1
header=Server=WildFly/10
header=Pragma=no-cache
header=Accept-Ranges=bytes
header=Date=Mon, 09 May 2016 08:18:33 GMT
header=Connection=keep-alive
header=ETag=W/"239-1462554016000"
header=Last-Modified=Fri, 06 May 2016 17:00:16 GMT
header=Content-Type=text/html
header=Content-Length=239
status=200
==============================================================
2016-05-09 09:18:34,112 INFO [io.undertow.request.dump] (default task-6)
----------------------------REQUEST---------------------------
URI=/ecc/secure/home.jsf
characterEncoding=null
contentLength=-1
contentType=null
cookie=EPMSID=sfTmDLw92HjAhwfY7HUei5fzlUbwKjxUg3EhyTMk.d014349
header=Accept=text/html, application/xhtml+xml, */*
header=Connection=Keep-Alive
header=Accept-Language=pt-PT
header=Accept-Encoding=gzip, deflate
header=Cookie=EPMSID=sfTmDLw92HjAhwfY7HUei5fzlUbwKjxUg3EhyTMk.d014349
header=User-Agent=Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
header=Host=localhost:8443
locale=[pt_PT]
method=GET
protocol=HTTP/1.1
queryString=
remoteAddr=sibshare/127.0.0.1:62990
remoteHost=sibshare
scheme=https
host=localhost:8443
serverPort=8443
--------------------------RESPONSE--------------------------
contentLength=2897
contentType=text/html;charset=UTF-8
cookie=EPMSID=KcblRlqogTv4hCuVtjeL27onM3Nbp04k--DDZfnt.d014349; domain=null; path=/ecc
header=Expires=0
header=Expires=0
header=Cache-Control=no-cache, no-store, must-revalidate
header=Cache-Control=no-cache, no-store, must-revalidate
header=X-Powered-By=Undertow/1
header=Set-Cookie=EPMSID=KcblRlqogTv4hCuVtjeL27onM3Nbp04k--DDZfnt.d014349; path=/ecc; secure; HttpOnly
header=Server=WildFly/10
header=Pragma=no-cache
header=Pragma=no-cache
header=Date=Mon, 09 May 2016 08:18:34 GMT
header=Connection=keep-alive
header=Content-Type=text/html;charset=UTF-8
header=Content-Length=2897
status=200
==============================================================
2016-05-09 09:18:44,841 INFO [io.undertow.request.dump] (default task-13)
----------------------------REQUEST---------------------------
URI=/ecc/j_security_check
characterEncoding=null
contentLength=68
contentType=[application/x-www-form-urlencoded]
cookie=EPMSID=KcblRlqogTv4hCuVtjeL27onM3Nbp04k--DDZfnt.d014349
header=Accept=text/html, application/xhtml+xml, */*
header=Accept-Language=pt-PT
header=Cache-Control=no-cache
header=Accept-Encoding=gzip, deflate
header=User-Agent=Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
header=Connection=Keep-Alive
header=Content-Type=application/x-www-form-urlencoded
header=Content-Length=68
header=Cookie=EPMSID=KcblRlqogTv4hCuVtjeL27onM3Nbp04k--DDZfnt.d014349
header=Referer=https://localhost:8443/ecc/secure/home.jsf
header=Host=localhost:8443
locale=[pt_PT]
method=POST
protocol=HTTP/1.1
queryString=
remoteAddr=sibshare/127.0.0.1:62993
remoteHost=sibshare
scheme=https
host=localhost:8443
serverPort=8443
--------------------------RESPONSE--------------------------
contentLength=0
contentType=null
cookie=EPMSID=JtIoopj1u-p_Ko95XwYi45HqkdzNBVRxSklVFQEL.d014349; domain=null; path=/ecc
header=Expires=0
header=Cache-Control=no-cache, no-store, must-revalidate
header=X-Powered-By=Undertow/1
header=Set-Cookie=EPMSID=JtIoopj1u-p_Ko95XwYi45HqkdzNBVRxSklVFQEL.d014349; path=/ecc; secure; HttpOnly
header=Server=WildFly/10
header=Pragma=no-cache
header=Date=Mon, 09 May 2016 08:18:44 GMT
header=Connection=keep-alive
header=Content-Length=0
status=200
==============================================================
答案 0 :(得分:0)
我最终弄明白了什么是错的。 在我的登录页面中,我配置了以下监听器以使活动会话无效:
<f:metadata>
<f:event type="preRenderView" listener="#{manager.invalidateActiveSession}" />
</f:metadata>
此侦听器只会使会话无效(如果存在):
HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
if (session != null ) {
synchronized( session ) {
session.invalidate();
}
}
这就是造成这种奇怪行为的原因。这个相同的代码在GlassFish上运行良好。 我已将代码更改为另外验证Principal是否也为空。