(including admin) via 'Forget Your Password'
(OFBIZ-4361)
Trunk backport r1866478 and r1866518
Currently, any user (via ecommerce 'Forget Your Password') has the ability to
reset another users password, including 'admin' without permission.
By simply entering 'admin' and clicking 'Email Password', the following is
displayed:
The following occurred:
A new password has been created and sent to you. Please check your Email.
This now forces the user of the ERP to change their password.
It is also possible to generate a dictionary attack against ofbiz because there
is no capta code required. This is serious security risk.
I have modified the patch following comments I made in the Jira, notably
Removed unused Java variables
Removed a check in LoginEvents::forgotPassword which prevented to show error
messages
Changed fr and en SecurityExtPasswordSentToYou
+ SecurityExtThisEmailIsInResponseToYourRequestToHave labels
+ template PasswordEmail.ftl
+ loginservices.token_incorrect labels
Added fr and en SecurityExtIgnoreEmail + SecurityExtLinkOnce labels
Removed changes in general.properties
I did not remove the 2 GetSecurityQuestion.ftl files (webpos one was still in)
There is still room for improvement. I'll discuss them on the Jira and dev
ML. But this version is already strong enough to not wait that the patch is
inapplicable!
Thanks: mz4wheeler (Mike Z) for the Jira, Nicolas Malin for the patch, I guess
with some Gil's help, and all others for comments and ideas
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1867296 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10515)
Introduce a new feature that allow the impersonation of a login by an authorized user.
Add the documentation with all the details in security-impersonation.adoc.
Big thanks to Leila, Nicolas and Jacques for your contribution to this implementation.
Big thanks to Mathieu, Jacques, Pierre and Taher for your remarks and reviews that
improved this contribution quality.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1842110 13f79535-47bb-0310-9956-ffa450edef68
jleroux: the issue description is quite lengthy so I will summarise it here, please refer to the Jira issue for details.
"When a customer creates an account on eCommerce site, s/he will also need to answer a security question. This security question then can be used by the user to reclaim her/his account in case s/he forgets her/his password. If the user correctly answers the required security question while reclaiming her/his account, her/his password will be sent through email notification. This part would work in the same way as the existing functionality of email password (forget password)."
The description was actually more ambitious (several questions, possibility for users to create own questions) but AFAIK these parts have not been implemented.
Apart updating the patch which did not merge, I got 2 majors issues (and few others I will not report here) I bypassed with workarounds.
Unlike Harsha, and as I reported earlier in the issue, I never got the username (userLoginId) back when using hidden parameters in the request body (not in requestParameters, ie UtilHttp.getParameterMap(request)), nor actually any parameters. This is maybe due to my OS (Windows7 was XP before) or my email client (Outlook Express then, now Thunderbird) or even my SMTP configuration (I used my ISP SMTP server) but most probably because I did it all on my sole machine (localhost). I tried to understand what was happening to request body parameters with http://www.telerik.com/fiddler, but finally gave up because it's even more complicated when https is in the picture. So I decided to rather use parameters in the URL (Query string). It's a bit less safe, though the password is OFBiz encrypted, and should be replaced. But it's safe enough because only the user should receive this message and even if the message is sniffed during its journey it should be hard to decrypt the password!
Harsha used the SecurityExtUiLabels.xml (created by ashish at r1618415) in securityext component but there is already a SecurityextUiLabels.xml in common component. Since I use Windows OFBiz was unable to retrieve the labels from SecurityExtUiLabels.xml since I guess it looked into a SecurityextUiLabels.xml. So I renamed a SecurityExtUiLabels.xml to EmailPassword.xml.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1716915 13f79535-47bb-0310-9956-ffa450edef68
added/revised zh-TW translations in the framework, applications and specialpurpose folders to have consistent, commonly-used meaningful terms in Traditional Chinese.
jleroux: from Nick Ho's patch I have extracted only the Chinese changes, w/o the proposed dash to underscore changes
This contains notably this 14 "zh" (not "sh-TW") changes:
<value xml:lang="zh">人将由电子邮件接受一个临时密码。</value><!-- was 客户将通过电子邮件收到一个临时密码。 -->
<value xml:lang="zh">合计属于公司: </value>
<value xml:lang="zh"> 完整文本:${fullText}</value>
<value xml:lang="zh">供货商佣金百分比</value>
<value xml:lang="zh">文本大小</value>
<value xml:lang="zh">值</value>
<value xml:lang="zh">算子</value>
<value xml:lang="zh">不能转移已序列化的库存。</value>
<value xml:lang="zh">货运收据</value>
<value xml:lang="zh">获取标识为 ${productStoreShipMethId} 的产品店铺送货方法(ProductStoreShipmentMeth)时出错:${errorString}</value>
<value xml:lang="zh">中国人民币元</value>
<value xml:lang="zh">如果选择"specify other",下拉框旁边会出现文本框。参考form的drop-down元素的other-field-size属性说明</value>
<value xml:lang="zh">文本消息</value>
<value xml:lang="zh">能够收到和解析XML消息,但是BSR->NOUN(买卖关系->名词) ${bsrNoun} 和/或 BSR->VERB(买卖关系->动词) ${bsrVerb} 是空的</value>
I have no competency to judge these changes, but from previous Shi Jinghai's feedback I believe there are OK
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1625816 13f79535-47bb-0310-9956-ffa450edef68
more added/updated translations patch files for zh-TW locale
jleroux:
I added the label
<value xml:lang="zh_TW">服務執行程式拋出一個異常</value>
by hand
Only 1 label was not added:
<value xml:lang="zh_TW">代號</value>
Because of the fuzziness and presence of several possibilities
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1621688 13f79535-47bb-0310-9956-ffa450edef68
1. Make "password must be different from last passwords" function work. (--// FIXME: switching to salt-based hashing breaks this history lookup below)
2. When there's error occurs, return "requirePasswordChange" instead of "error". Then, "password change" form will not be redirected to "login" form if there's any kind of "error".
3. Fix one "deprecated" findByAnd call.
4. Return the "error" message instead of "event" message when password expires.
5. Chinese translation for "password expiration alert" and "password expired" message.
jleroux: I only reviewed (no tests) but seems good to me
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1470127 13f79535-47bb-0310-9956-ffa450edef68
Reference requirement for the feature: http://markmail.org/message/sihxekwk6655t5gh#query:+page:1+mid:bcw2vva2hjxhsodq+state:results
For a user account in system, we can set password age for an additional security.
Proposed system will start suggesting to user to reset his password few days before password expiration. Then Once password expired, system will enforce him to reset his password before processing further.
Following will be control points and would be part of system configuration-
* *Control Points -*
** Admin can enable/disable the reset password functionality.
*** -It will control by a flag in propriety file where admin can enable/disable it by setting true/false.
** Number of days in which password will expired.
*** - It will defined in propriety file so that admin can control it.
** Number of days before when password expiration alert display at user's screen.
*** - It will defined in propriety file so that admin can control it.
* *How should it processed -*
** After user logged-in, display password expiration notification message to user if his password will expire in comming days.
** After user logged-in, display change password screen, when password is expired. i.e. The difference in days since last time password updated is exceed to number of days specified in system policies. Enforce user to reset his password.
* *What will be the out-put -*
** Password is about to expire : : alert message after login.
** Password is expired : Password-Expired-Alert : alert message with reset password screen.
Following is implementation plan -
security.properties : Provide configuration for following control points :
Enabling / Disabling of the functionality.
Maximum number of days within user has to change the password.
Number of days back to password expire date, when user start getting password expiration alerts.
Data model
Entity name : UserLoginPasswordHistory : Existing entity.
Business logic
Create UserLoginPasswordHistory record when a new user is created (if configured).
Expire and then Create UserLoginPasswordHistory record when user update existing password.
Everytime, when user login check for password expiration. If password expired then display change password screen to user. And if password not yet expired but it is close to expire display alert message to user about its expiration.
jleroux: I just changed
from
if (reqToChangePwdInDays != 0) {
tp
if (reqToChangePwdInDays > 0) {
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1465185 13f79535-47bb-0310-9956-ffa450edef68
Provides an additional validation for password with following capability to the system:
Admin can enable/disable pattern based password capability of system. Configuration will reside in security.property file.
To enable : security.login.password.pattern.enable=true
To disable: security.login.password.pattern.enable=false
Admin is flexible to provide his pattern string by making pattern more/less restrictive as per system requirement. Configuration will reside in security.property file.
Example: security.login.password.pattern=^.*(?=. {5,})(?=.[a-zA-Z])(?=.[!@#$%^&*]).*$
Admin can provide custom error message string which will display to end user if wrong password is entered. Configuration will reside in security.properity file.
jleroux: I quickly handled the error message localisation for the OOTB case. It's more complicated when the pattern gets complex...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1418996 13f79535-47bb-0310-9956-ffa450edef68
I finally kept also the previous way because it allow an easier 18n of at the email subject.
Still the same concern: OOTB, if the user has not set a SMPT server in general.properties for the defaultFromEmailAddress the message "A new password has been created and sent to you. Please check your Email." when actually nothing happens. But that's anyway user's responsibility
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1310716 13f79535-47bb-0310-9956-ffa450edef68
There is no productStoreId in the session for an user of a backend application, and ProductStoreEmailSetting is not available. This is the reason.
However we can use default template and default sender's address from general.properties in this case.
Also removes some dead code.
jleroux: this uses "general.properties", "defaultFromEmailAddress". So to work correctly it still needs "defaultFromEmailAddress" (default =ofbiztest@example.com), "mail.smtp.relay.host" (default =localhost) and such to be set correctly... In other words the message "A new password has been created and sent to you. Please check your Email." could even more misleading if people are not aware about setting SMTP
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1307895 13f79535-47bb-0310-9956-ffa450edef68