Commit Graph
40 Commits
Author SHA1 Message Date
Michael Brohl be5f4bddb6 Applied fix from trunk for revision: 1852882
===

Fixed: Error parsing JWT
(OFBIZ-10814)

Fixes incorrect retrieval of the Authorization header JWT token. 
Fixes wrong API usage for the key parameter which assumed the key is
provided in BAS64 format.
Refactored the code to use helper methods for key and auth header 
retrieval.
Javadoc corrections and enhancements.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1852884 13f79535-47bb-0310-9956-ffa450edef68
2019-02-04 09:26:42 +00:00
Jacques Le Roux d53238e430 Improved: Tomcat SSO in Cluster
(OFBIZ-10123)

Finally this was not done, noted in security.properties

Thanks: James Yong for the proposition, Michael for the discussionn in 
OFBIZ-10047

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1849796 13f79535-47bb-0310-9956-ffa450edef68
2018-12-27 10:18:32 +00:00
Jacques Le Roux fbfa0daa5a Implemented: Navigate from a domain to another with automated signed in
authentication
(OFBIZ-10307)

This uses a JWT Token authentication to get from one domain, where you are 
signed in, to another domain where you get signed in automatically. 
Something like ExternalLoginKey or Tomcat SSO, but not on the same domain.

In the example component, the FormWidgetExamples screen contains 2 new fields 
in the LinksExampleForm which demonstrate the use from a local instance to the
trunk demo instance.

A simple documentation is available in 
  framework\webapp\src\docs\asciidoc\_include\wa-cross-domains-SSO.adoc

Thanks: Taher for review

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1844880 13f79535-47bb-0310-9956-ffa450edef68
2018-10-26 09:32:46 +00:00
Gil Portenseigne 54ad6c68fa Fixed : Impersonation of userLogin feature
(OFBIZ-10515)

Fix default value of impersonation feature to true (unchanged after last test before commit...) 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1842111 13f79535-47bb-0310-9956-ffa450edef68
2018-09-27 16:11:40 +00:00
Gil Portenseigne a61c98775f Implemented : Impersonation of userLogin feature
(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
2018-09-27 16:01:35 +00:00
Jacques Le Roux ca9b1bbd41 Reverted: Navigate from a domain to another with automated signed in
authentication
(OFBIZ-10307)

This reverts the work done previously for OFBIZ-9833 and OFBIZ-10206
Most parts of it will actually be reused later in a patch. By reverting it will 
allow to provide a patch for others to review


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1833510 13f79535-47bb-0310-9956-ffa450edef68
2018-06-14 14:37:24 +00:00
Jacques Le Roux 5977381e62 Reverted: Secure the login.secret_key_string
(OFBIZ-9966)

I forgot to revert this part; I guess got conflict issues and then forgot.

I'll also revert in R16 and R17 and close as won't fix, I gave my arguments
that's enough for me.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1824855 13f79535-47bb-0310-9956-ffa450edef68
2018-02-20 11:59:07 +00:00
Jacques Le Roux f26b20885a No functional change, removes reference to MD5 in comments. It's not used anymore
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1824128 13f79535-47bb-0310-9956-ffa450edef68
2018-02-13 12:51:30 +00:00
Jacques Le Roux 619d31e331 Completed:: Security issue in Token Based Authentication
(OFBIZ-10206)

Updates the security.properties content related to JWT
 Refers to the last up to date external-server-test-example.patch at OFBIZ-10206
 Makes demo-trunk.ofbiz.apache.org default external-server-name so that anybody
 can try the feature from own machine. The use-external-server=Y was already set

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1823467 13f79535-47bb-0310-9956-ffa450edef68
2018-02-07 14:17:51 +00:00
Jacques Le Roux 97a9b690dd Fixed: Security issue in Token Based Authentication
(OFBIZ-10206)

The version I committed so far in OFBIZ-9833 has a small security issue.
See the Jira description for all details

To test I have attached a OFBIZ-10206-external-server-test-example.patch to 
the Jira

This removes the external-server-query property now useless

In  ContextFilter the getHeader (wrapper) now uses an autoLoginCookie to get 
the userLoginId passed in the JWT instead of externalServerUserLogin parameter.
A sourceServerWebappName parameter must be passed from the client request to
allow reading the autoLoginCookie.

This userLoginId is then retrieved on the target server from the JWT in the 
externalServerLoginCheck which is simplified.

In LoginWorker
  getAutoLoginCookieName() has now 2 versions to allow to pass a webappname

  A new autoLogoutFromAllBackendSessions() method has been added but for now 
  commented out. Decommenting it out will be submitted as a patch in OFBIZ-4959.

Thanks: Leila Mekika for reporting the security issue directly to me

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1823324 13f79535-47bb-0310-9956-ffa450edef68
2018-02-06 13:17:57 +00:00
Jacques Le Roux 714e6e3521 Improved: Token Based Authentication
(OFBIZ-9833)

I just thought that for security it's best to have both the source and 
target server using the use-external-server property.

Also default to N when requesting this property

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1822882 13f79535-47bb-0310-9956-ffa450edef68
2018-02-01 15:27:17 +00:00
Jacques Le Roux 9b6e65bd20 No functional change, clarifies for demo
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1822877 13f79535-47bb-0310-9956-ffa450edef68
2018-02-01 14:41:48 +00:00
Jacques Le Roux 492c78a4d5 No functional change, just clarifies things a bit
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1822518 13f79535-47bb-0310-9956-ffa450edef68
2018-01-29 15:27:25 +00:00
Jacques Le Roux 0ca7c12475 Improved: Token Based Authentication
(OFBIZ-9833)

No functional change

As reported by Jinghai on dev ML we should better use "Authorization" than
 "Authorisation" when retrieving the JWT token, even if both are accepted
https://en.wikipedia.org/wiki/List_of_HTTP_header_fields
Also improves the comment on token ttl

Thanks: Jinghai for report

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1821600 13f79535-47bb-0310-9956-ffa450edef68
2018-01-19 08:39:05 +00:00
James Yong ba2e822f27 Implemented: Tomcat SSO
(OFBIZ-10047)

This allow developers the option to use Tomcat SSO, instead of externalLoginKey, for SSO.

Thanks: Jacques and Michael for the reviews

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1819133 13f79535-47bb-0310-9956-ffa450edef68
2017-12-23 10:39:44 +00:00
Jacques Le Roux 0d0badf38e Implemented: Token Based Authentication
(OFBIZ-9833)

I have tested the Token Based Authentication between my local machine and the 
trunk demo. It works as expected.

This completes the previous commit by:
  adding a new externalServerLoginCheck pre processor
  Documenting how to set the ExternalServerJwtMasterSecretKey in production
    using sed and uuidgen
  Adding documenting properties in security.properties, not set to be used OOTB
   but ready to be set in production

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1814363 13f79535-47bb-0310-9956-ffa450edef68
2017-11-05 17:33:30 +00:00
Jacques Le Roux 8289e03096 Fixed: Secure the login.secret_key_string
(OFBIZ-9966)

When OFBIZ-4983 was implemented I missed that we put the login.secret_key_string
 as a property in security properties. This should not have been because it 
eases attackers work.

The recommended way is to have it as a private static final String that can be 
changed just when compiling using sed and uuidgen. So then the key is temporay 
and final and it gets quite harder for a possible attacker to use this mean.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1814349 13f79535-47bb-0310-9956-ffa450edef68
2017-11-05 11:28:42 +00:00
Jacques Le Roux 77be02222b Reverts, this slipped in inadvertently with r1814292
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1814348 13f79535-47bb-0310-9956-ffa450edef68
2017-11-05 11:07:50 +00:00
Jacques Le Roux 8693fb0bdc Improved: Replace Inline Javascript with External Javascript
(OFBIZ-9465)

As discussed in http://ofbiz.markmail.org/thread/ti54omjdt4fy662m 
inline javascript for various macros like renderLookupField, makeHyperlinkString,
shortDateInput etc in HtmlFormMacroLibrary.ftl should be replaced with a generic 
code written as external javascript. Generic Javascript code should be written 
in OfbizUtil.js and appropriate classes or identifiers should be used for 
applying that. Any additional data can be passed with HTML 5 custom data attribute 
(https://www.w3.org/TR/2011/WD-html5-20110525/elements.html
#embedding-custom-non-visible-data-with-the-data-attributes).


Deepak: I think we can use data-mask attribute to recognize the element instead 
of adding class. 

jeloux: I noticed a MaskFieldExampleForm was introduced with r1804027 but
not used in FormWidgetExampleScreens.xml so was not visible


Thanks: Aditya and Deepak


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1814292 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 14:06:56 +00:00
Shi Jinghai 71acaf13e7 Improved: LoginWorker HashCrypt the type of hash for one-way encryption
(OFBIZ-8537)

Committed wangjunyuan's new patch.

Thanks: wangjunyuan for the new patch to make the PBKDF2 hashed password comply with RFC 6070, the feedbacks of Jacques and Nicolas on the previous patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1773066 13f79535-47bb-0310-9956-ffa450edef68
2016-12-07 12:45:15 +00:00
Shi Jinghai dbcfeaefb0 Implemented: LoginWorker HashCrypt the type of hash for one-way encryption
Added PBKDF2 hash type to encrypt password.

Thanks: wangjunyuan for this contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1772589 13f79535-47bb-0310-9956-ffa450edef68
2016-12-05 01:32:51 +00:00
Deepak Dixit 834691742b (OFBIZ-6274) Renamed OFBiz artefacts from org.ofbiz.* to org.apache.ofbiz.*.Thanks to Taher for working on it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752920 13f79535-47bb-0310-9956-ffa450edef68
2016-07-16 10:30:49 +00:00
Jacques Le Roux 0dd553ec96 A modified patch from Harsha Chadhar for "New feature to reclaim a user account - Using Security Questions" https://issues.apache.org/jira/browse/OFBIZ-4983
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
2015-11-27 20:37:15 +00:00
Adrian Crum 57816747d7 Refactored SecurityFactory implementation - use Java's ServiceLoader to discover Security implementations, instead of using configuration files.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1531577 13f79535-47bb-0310-9956-ffa450edef68
2013-10-12 18:54:59 +00:00
Jacopo Cappellato 2294582c2d Fixed typo in comment
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1517451 13f79535-47bb-0310-9956-ffa450edef68
2013-08-26 07:59:44 +00:00
Adam Heath 256a4af82b FEATURE: Allow for externalLoginKey parameter generation to be turned
off; the use for this feature will become apparent shortly.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1497891 13f79535-47bb-0310-9956-ffa450edef68
2013-06-28 19:08:24 +00:00
Jacques Le Roux 54ece545d9 I missed to commit security.properties with r1465185. Thanks to Leon for warning
+ French labels


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1465347 13f79535-47bb-0310-9956-ffa450edef68
2013-04-07 09:08:21 +00:00
Jacques Le Roux 03a62ac947 A slightly modified patch from Sumit Pandit for "Additional Validation for Password : Make password pattern driven" https://issues.apache.org/jira/browse/OFBIZ-4958
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
2012-12-09 14:59:52 +00:00
Jacques Le Roux b8689d9e7a A patch from Sascha Rodekamp "Security Update for forgotten passwords " (https://issues.apache.org/jira/browse/OFBIZ-3842) - OFBIZ-3842
Improve the a random Password generation when the "require new password" function is called. In the current Trunk it's a kind of hard coded password that will be send to the user. After generating a new pass the "requireNewPassword" flag will be set to true (configurable).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1038209 13f79535-47bb-0310-9956-ffa450edef68
2010-11-23 17:13:53 +00:00
Jacques Le Roux b9c3ddef08 2d part and end of an effort to remove trailing spaces
[ \t]+$ => "" (empty)
Should be easier to review when committing changes with trailing spaces removed automatically by anyedit or such tool (please refer to http://docs.ofbiz.org/x/mg)

Of course this effort to remove trailing spaces has no functional implications.

Actually, I was doing a 1st commit and as it's long to upload, I got conflicts with r763135
In the meantime I did some refactoring also in *.java and *.groovy files :
){ => ) {
if( => if (
while( => while (
}else => } else
else{ => else {
switch( => switch (
try{ => try {
}catch => } catch
catch( => catch (
}finally{ => } finally {

So these changes are also in this commit, should not be a problem anyway.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@763175 13f79535-47bb-0310-9956-ffa450edef68
2009-04-08 10:54:51 +00:00
Jacques Le Roux 40f1371b56 A patch from Guy Gershoni "Allow use of HttpServletRequest.getRemoteUser() for 3rd party authentication" '(https://issues.apache.org/jira/browse/OFBIZ-1906) - OFBIZ-1906
I did not test the CAS case, but reviewed the code and tested in std mode (not using CAS) and it's OK

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@736660 13f79535-47bb-0310-9956-ffa450edef68
2009-01-22 14:52:24 +00:00
Jacques Le Roux f36843386d Close "Grey list feature for confidential data access" (https://issues.apache.org/jira/browse/OFBIZ-2074) - OFBIZ-2074
I put an explanation in http://docs.ofbiz.org/display/OFBTECH/OFBiz+security

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@727508 13f79535-47bb-0310-9956-ffa450edef68
2008-12-17 20:50:11 +00:00
Adrian Crum b06a17e6fd Added LDAP user authentication, based on work contributed by Mohamed Amine Azzi and Torsten Schlabach - https://issues.apache.org/jira/browse/OFBIZ-811.
Internationalization note: this commit contains new UI labels.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@669994 13f79535-47bb-0310-9956-ffa450edef68
2008-06-20 17:09:19 +00:00
Andrew Zeneski 5095e4e09f added support for third party policy servicers; setting the userLoginId in a request header, ofbiz will assume the user has already been authenticated and log the user in.
This is DISABLED by default (see security.properties) be sure your policy server is running in front of ofbiz to avoid security issues (spoofing).

Jira: OFBIZ-1781


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@656008 13f79535-47bb-0310-9956-ffa450edef68
2008-05-13 20:59:03 +00:00
Andrew Zeneski 08362be9c0 implemented code to support pre-account email verification (verify email before account is created)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@582705 13f79535-47bb-0310-9956-ffa450edef68
2007-10-08 03:48:24 +00:00
Andrew Zeneski 6548a71c1e implementation (from Anil Patel) to support restricting changed passwords to not allow the use of a previous password (the length of tracking is configurable in security.properties)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@573458 13f79535-47bb-0310-9956-ffa450edef68
2007-09-07 04:58:35 +00:00
Andrew Zeneski 5073124b68 made the pattern which finds the userLoginId from the common name (x500) configurable; also can disable cert login from security.properties
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@532403 13f79535-47bb-0310-9956-ffa450edef68
2007-04-25 16:45:18 +00:00
Jacques Le Roux 64cea174fc This is the change of ASL2 headers in properties files only. Please see comments in another post in dev ML.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@497074 13f79535-47bb-0310-9956-ffa450edef68
2007-01-17 16:49:01 +00:00
Jacopo Cappellato b6bea2ca8b License change from MIT to ASL2.0 for the files of the security component.
Thanks to Scott Gray for the patch (Apache OFBIZ-87).

git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@423841 13f79535-47bb-0310-9956-ffa450edef68
2006-07-20 09:00:48 +00:00
David E. Jones 94fe6d1cda Initial OFBiz import from revision 7923 of the old svn.ofbiz.org SVN repository.
git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@418498 13f79535-47bb-0310-9956-ffa450edef68
2006-07-01 19:05:20 +00:00