[英]How to get login credentials in liferay?
I made a hook by implementing login.jsp
inside /html/portlet/login
folder.我通过在
/html/portlet/login
文件夹中实现login.jsp
制作一个钩子。 Now I tried to get the login credentials submitted through the default login form.现在我尝试获取通过默认登录表单提交的登录凭据。 The code which I tried is:-
我试过的代码是:-
request.getParameter("login")
but it could not retrieve login credential so I want to ask how to retrieve login credential.但它无法检索登录凭据,所以我想问一下如何检索登录凭据。
You can get username and password by using following ways:您可以通过以下方式获取用户名和密码:
String username = themeDisplay.getUser().getScreenName();
String password = (String)request.getSession().getAttribute(WebKeys.USER_PASSWORD);
and write the below lines in portal-ext.properties:并在portal-ext.properties 中写入以下几行:
session.store.password=true
session.shared.attributes.excludes=
But you need to take the precaution because when you use session.store.password=true then passwords will be stored n clear text and the same will be appear in dumps.但是您需要采取预防措施,因为当您使用 session.store.password=true 时,密码将以明文形式存储,并且相同的内容将出现在转储中。
I hope this resolves your issue.我希望这能解决您的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.