如何使用基于表单的身份验证登录后获取用户名 [英] How to get username after login with FORM based authentication

查看:47
本文介绍了如何使用基于表单的身份验证登录后获取用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注链接 http://middlewaremagic.com/weblogic/?p=2034 执行基于表单的身份验证.我创建了一个安全领域,然后成功地将身份验证检查委托给了 weblogic 10.3.一切都很好,但我无法获取用户名,HttpServletRequest->getRemoteUser() 返回 null.

I am following the link http://middlewaremagic.com/weblogic/?p=2034 to perform form based authentication. I have created a security realm then successfully delegate the authentication check to weblogic 10.3. Everything is fine, but I could not get username, HttpServletRequest->getRemoteUser() returns null.

您知道如何在登录后获取用户名吗?我将在每个托管 bean 中使用用户名来记录用户操作.

Do you have an idea how to get username after login? I am going to use username in every Managed bean to log user operations.

我发现我的错误是在登录用户操作(注销操作)之前使会话无效,这就是 HttpServletRequest->getRemoteUser() 返回 null 的原因.感谢您的贡献.

I have found my mistake that I invalidated the session before logging user operation (logout operation), that is why HttpServletRequest->getRemoteUser() returns null. Thanks for contribution.

推荐答案

我发现我的错误是在登录用户操作(注销操作)之前使会话无效,这就是 HttpServletRequest->getRemoteUser() 返回 null 的原因.感谢您的贡献.

I have found my mistake that I invalidated the session before logging user operation (logout operation), that is why HttpServletRequest->getRemoteUser() returns null. Thanks for contribution.

这篇关于如何使用基于表单的身份验证登录后获取用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆