简体   繁体   English

测试用户是否已通过身份验证Java过滤器Websphere 8服务器

[英]Testing if user is authenticated java filter Websphere 8 server

We have a websphere application server that runs a java filter when j_security_check is run. 我们有一个Websphere应用程序服务器,该服务器在运行j_security_check时运行Java过滤器。 We authenticate a user using Websphere's custom registry. 我们使用Websphere的自定义注册表对用户进行身份验证。 When the filter runs I need to know whether or not the user that logged in was authenticated. 筛选器运行时,我需要知道登录用户是否已通过身份验证。 I have tried to get the remote user from the request but it returns null if the user authenticated successfully or not successfully. 我试图从请求中获取远程用户,但是如果用户认证成功或不成功,它将返回null。 It seems that the remote user has not been built when this filter runs. 运行此筛选器时,似乎尚未构建远程用户。 I am assuming that the custom registry code runs before the java filter runs. 我假设自定义注册表代码在Java筛选器运行之前运行。

Is there anyway to test if the user has been successfully authenticated inside of my java filter. 无论如何,有没有测试用户是否已在我的java过滤器内成功通过身份验证。

Thanks Doug 谢谢道格

I have found the answer. 我找到了答案。 I was testing for the remote user before the chain.doFilter() method was called, in my filter. 在我的过滤器中调用chain.doFilter()方法之前,我正在测试远程用户。 The authentication process (In Websphere) happens after the doFilter chain happens. 认证过程(在Websphere中)在doFilter链发生之后进行。 So I moved my code that checks if a user is authenticated after the chain.doFilter() method. 所以我移动了代码,检查chain.doFilter()方法之后是否对用户进行了身份验证。 This fixed the issue. 这解决了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM