留言板
Changing Login Error Messages
Hi,
I was wondering how to go about changing the login errors you receive if logging in incorrectly.
Currently you receive:
"You have entered invalid data. Please try again"
and
"Authentication failed. Please try again"
I would like to have that changed to one generic error message:
"Login failed; Please try again"
Thanks for the help!
Aaron
I was wondering how to go about changing the login errors you receive if logging in incorrectly.
Currently you receive:
"You have entered invalid data. Please try again"
and
"Authentication failed. Please try again"
I would like to have that changed to one generic error message:
"Login failed; Please try again"
Thanks for the help!
Aaron
Pranay R Patadiya,修改在13 年前。
RE: Changing Login Error Messages
Regular Member 帖子: 177 加入日期: 10-2-23 最近的帖子
Hi,
Login error message is just a message written in language property files.
For authentication fail the language key is authentication-failed.
For English language you need to over ride Language_en_EN.properties, make a hook for that.
Other messages you can find in the same file of portal source.
Thanks,
Pranay Patadiya
Login error message is just a message written in language property files.
For authentication fail the language key is authentication-failed.
For English language you need to over ride Language_en_EN.properties, make a hook for that.
Other messages you can find in the same file of portal source.
Thanks,
Pranay Patadiya
Hi Aaron,
Go into login.jsp in Login portlet,u will find the following code there:
<liferay-ui:error exception="<%= AuthException.class %>" message="authentication-failed" />
<liferay-ui:error exception="<%= CookieNotSupportedException.class %>" message="authentication-failed-please-enable-browser-cookies" />
<liferay-ui:error exception="<%= NoSuchUserException.class %>" message="please-enter-a-valid-login" />
<liferay-ui:error exception="<%= PasswordExpiredException.class %>" message="your-password-has-expired" />
<liferay-ui:error exception="<%= UserEmailAddressException.class %>" message="please-enter-a-valid-login" />
<liferay-ui:error exception="<%= UserLockoutException.class %>" message="this-account-has-been-locked" />
<liferay-ui:error exception="<%= UserPasswordException.class %>" message="please-enter-a-valid-password" />
<liferay-ui:error exception="<%= UserScreenNameException.class %>" message="please-enter-a-valid-screen-name" />
inorder to change the error message follow the example given below.
Eg: Suppose you want to change the error message for "please-enter-a-valid-login"
Go to Language.properties, find the message assigned to it
Eg: please-enter-a-valid-login=Please enter a valid login.
Paste your customized message in the following files
language-ext.properties and language-ext_en.properties
please-enter-a-valid-login=Login failed,Please try again.
deploy the changes and restart the server.
I hope this works for you.
Go into login.jsp in Login portlet,u will find the following code there:
<liferay-ui:error exception="<%= AuthException.class %>" message="authentication-failed" />
<liferay-ui:error exception="<%= CookieNotSupportedException.class %>" message="authentication-failed-please-enable-browser-cookies" />
<liferay-ui:error exception="<%= NoSuchUserException.class %>" message="please-enter-a-valid-login" />
<liferay-ui:error exception="<%= PasswordExpiredException.class %>" message="your-password-has-expired" />
<liferay-ui:error exception="<%= UserEmailAddressException.class %>" message="please-enter-a-valid-login" />
<liferay-ui:error exception="<%= UserLockoutException.class %>" message="this-account-has-been-locked" />
<liferay-ui:error exception="<%= UserPasswordException.class %>" message="please-enter-a-valid-password" />
<liferay-ui:error exception="<%= UserScreenNameException.class %>" message="please-enter-a-valid-screen-name" />
inorder to change the error message follow the example given below.
Eg: Suppose you want to change the error message for "please-enter-a-valid-login"
Go to Language.properties, find the message assigned to it
Eg: please-enter-a-valid-login=Please enter a valid login.
Paste your customized message in the following files
language-ext.properties and language-ext_en.properties
please-enter-a-valid-login=Login failed,Please try again.
deploy the changes and restart the server.
I hope this works for you.
Is there a way to change this dynamically form a class that implements Authenticator()?
..for example I'd like to change the value for "authentication-failed" based on a return status.
..for example I'd like to change the value for "authentication-failed" based on a return status.
David H Nebinger,修改在12 年前。
RE: Changing Login Error Messages
Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
Nope, it all relies upon the language bundle for the rendering.
You can change the language bundle to use parameters, then set those parameters in your custom authenticator to get the same result.
You can change the language bundle to use parameters, then set those parameters in your custom authenticator to get the same result.
David H Nebinger:
Nope, it all relies upon the language bundle for the rendering.
You can change the language bundle to use parameters, then set those parameters in your custom authenticator to get the same result.
Thanks.