Commit Graph
760 Commits
Author SHA1 Message Date
Shi Jinghai 17d9904b83 Reverted: Add method attribute to request-map to controll a uri can be called GET or POST only
OFBIZ-10438


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1834917 13f79535-47bb-0310-9956-ffa450edef68
2018-07-03 06:21:02 +00:00
Jacques Le Roux 39582de221 Improved: Factorize code logic from ‘ConfigXMLReader’
(OFBIZ-10453)

There is a lot of repetitive code in ConfigXMLReader. 
Using a functional interface as a parameter of a generic algorithm avoids those
repetitions.

Thanks: Mathieu Lirzin

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1834662 13f79535-47bb-0310-9956-ffa450edef68
2018-06-29 10:03:22 +00:00
Shi Jinghai b6a53caa21 Implemented: Add method attribute to request-map to controll a uri can be called GET or POST only
OFBIZ-10438

Add apache license to MethodNotAllowedException.java.

Thanks: Mathieu Lirzin for the contribution.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1834570 13f79535-47bb-0310-9956-ffa450edef68
2018-06-28 03:00:23 +00:00
Shi Jinghai 4abebaea5a Implemented: Add method attribute to request-map to controll a uri can be called GET or POST only
OFBIZ-10438

ControlServlet.java returned to the previous doGet/doPost structure.

Thanks: Mathieu Lirzin for the contribution.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1834465 13f79535-47bb-0310-9956-ffa450edef68
2018-06-27 05:48:59 +00:00
Shi Jinghai 68003b9526 Implemented: Add method attribute to request-map to controll a uri can be called GET or POST only
OFBIZ-10438

The request-map element has a new method attribute to control a uri be called by GET or POST or all.

Thanks: Mathieu Lirzin for the contribution.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1834389 13f79535-47bb-0310-9956-ffa450edef68
2018-06-26 02:00:33 +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 3304dec663 Fixed: The first visit event are not executed in case of CMS
(OFBIZ-10389)

Execution of the first visit events depends on the trackVisit function

In RequestHandler.java file

if (this.trackVisit(request) && session.getAttribute("_FIRST_VISIT_EVENTS_") == null) {
    // execute first visit event
}

trackVisit function does not honor the default controller request 
(in this case, cms) So, we should improve the code of trackVisit to honor 
default controller request.


Thanks: Swapnil M Mane

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832944 13f79535-47bb-0310-9956-ffa450edef68
2018-06-05 13:56:29 +00:00
Jacques Le Roux c704689c3a Improved: no functional change, removes trailing blanks
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832762 13f79535-47bb-0310-9956-ffa450edef68
2018-06-03 08:55:51 +00:00
Jacques Le Roux 25f853db70 Fixed: Session fixation issue
(OFBIZ-10420)

Prevents the session fixation by making Tomcat generate a new jsessionId 
(ultimately put in cookie). Only do when really signing in to avoid unnecessary 
calls

This improves the way it's done by using request.changeSessionId() instead of 
creating a brand new session. So there is no possible side effects on client and
no need to set initial request info (using setInitialRequestInfo)

Thanks: Taher for asking about it










git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832756 13f79535-47bb-0310-9956-ffa450edef68
2018-06-03 08:33:09 +00:00
Jacques Le Roux 598eee0d93 Fixed: Session fixation issue
(OFBIZ-10420)

Fixes a session fixation security issue discovered by a client with the security
 audit tool "IBM Security AppScan Enterprise , Version : 9.0.3.7"

Prevents the session fixation by making Tomcat generate a new jsessionId 
(ultimately put in cookie). 

Only do when really signing in to avoid unnecessary calls
Though if the client has disabled the use of cookies, then a session will be 
new on each request, not a good choice on client side!




git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832662 13f79535-47bb-0310-9956-ffa450edef68
2018-06-01 07:37:27 +00:00
Wei Zhang 6da8a7fc29 Fixed: Incorrect data type conversion of variable serviceEndTime in CoreEvents.java
(OFBIZ-10419)

A minor fix for serviceEndTime conversion

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832577 13f79535-47bb-0310-9956-ffa450edef68
2018-05-31 01:20:54 +00:00
Jacques Le Roux fc8348f410 Improved: Refactor JavaEventHandler class
(OFBIZ-10410)

Instead of relying on manual synchronisation, use a concurrent map for caching 
loaded classes.  
Inline private `invoke` delegate which intent was fuzzy.  
Spread arguments when calling `Method::invoke` and `Class::getMethod`.

jleroux: interesting, it's the 1st use in OFBiz of the "::" syntax for calling
methods
(cf. https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.13-500)
I note that the string "::" is used in many places as a separator, notably
in caches, as  cache key separator but this should not be confusing.

Thanks: Mathieu Lirzin

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832199 13f79535-47bb-0310-9956-ffa450edef68
2018-05-24 20:42:19 +00:00
Nicolas Malin 8e2d65f4d6 Fixed: ConfigXMLReader - Events are not executed in the order defined
(OFBIZ-10369)
The events contained in the controller configuration for first-visit, pre-post processor and before-after login are executed in arbitrary order rather than the defined order.
If we define an event configuration as follow:

    <after-login>
        <event name=keepCartUpdated type=java path=org.apache.ofbiz.order.shoppingcart.ShoppingCartEvents invoke=keepCartUpdated/>
        <event name=restoreAutoSaveList type=java path=org.apache.ofbiz.order.shoppinglist.ShoppingListEvents invoke=restoreAutoSaveList/>
        <event name=saveCartToAutoSaveList type=java path=org.apache.ofbiz.order.shoppinglist.ShoppingListEvents invoke=saveCartToAutoSaveList/>
    </after-login>

We wait that OFBIz run keepCartUpdated, restoreAutoSaveList and after saveCartToAutoSaveList event but the HashMap who organise them return arbitrary order and can return saveCartToAutoSaveList, keepCartUpdated and restoreAutoSaveList. Convert the HashMap to LinkedHashMap help to keep the loaded order.

Thanks to Vikas Mayur for solve this issue

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1830303 13f79535-47bb-0310-9956-ffa450edef68
2018-04-27 07:26:58 +00:00
Nicolas Malin b48d0cadc5 revert revision 1830301 that contains mix improvement, i will recommit them correclty
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1830302 13f79535-47bb-0310-9956-ffa450edef68
2018-04-27 07:26:33 +00:00
Nicolas Malin 2695743cae Fixed: ConfigXMLReader - Events are not executed in the order defined
(OFBIZ-10369)
The events contained in the controller configuration for first-visit, pre-post processor and before-after login are executed in arbitrary order rather than the defined order.
If we define an event configuration as follow:

    <after-login>
        <event name=keepCartUpdated type=java path=org.apache.ofbiz.order.shoppingcart.ShoppingCartEvents invoke=keepCartUpdated/>
        <event name=restoreAutoSaveList type=java path=org.apache.ofbiz.order.shoppinglist.ShoppingListEvents invoke=restoreAutoSaveList/>
        <event name=saveCartToAutoSaveList type=java path=org.apache.ofbiz.order.shoppinglist.ShoppingListEvents invoke=saveCartToAutoSaveList/>
    </after-login>

We wait that OFBIz run keepCartUpdated, restoreAutoSaveList and after saveCartToAutoSaveList event but the HashMap who organise them return arbitrary order and can return saveCartToAutoSaveList, keepCartUpdated and restoreAutoSaveList. Convert the HashMap to LinkedHashMap help to keep the loaded order.

Thanks to Vikas Mayur for solve this issue

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1830301 13f79535-47bb-0310-9956-ffa450edef68
2018-04-27 07:21:47 +00:00
Jacques Le Roux 0d919a3774 Fixed: Token Based Authentication
(OFBIZ-9833)

Reverts change in ContextFilter.java committed with 1813679, was wrong

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1827441 13f79535-47bb-0310-9956-ffa450edef68
2018-03-21 20:59:49 +00:00
Jacques Le Roux 7ff43dd657 Improved: no functional change, fixes a format issue in LoginWorker
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1827407 13f79535-47bb-0310-9956-ffa450edef68
2018-03-21 12:30:21 +00:00
Jacques Le Roux 1592f169af Improved: Token Based Authentication
(OFBIZ-9833)

Removes the code I temporarily removed on trunk demo (controversial) to test my 
changes

Also adds the LoginWorker.autoLoginSet()

This is just a commit to go ahead, later I will revert all related and provide 
a patch for discussion at OFBIZ-9833.

I'll also certainly use Deepak's JWTManager.createJwt() instead of mine, it's
more general and I actually only need to pass the userLoginId. We have though
to discuss that anyway, I see some differences...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1826949 13f79535-47bb-0310-9956-ffa450edef68
2018-03-16 10:02:03 +00:00
Jacques Le Roux d354300e69 Fixed: Logout do not remove autoLogin
(OFBIZ-4959)

I used the only available (and I must say confusing) WebappInfo.getName() when
I needed the webAppName not the WebappInfoName. So this put in a new 
WebappInfo.getMountPoint() and use it in getWebappInfo

Also use LoginWorker.autoLoginSet() in different places where I missed it. In 
other words all autoUserLogin coockies are deleted on login and logout, and
an autoUserLogin cookie is created when going locally from a webapp to another,
with checkExternalLoginKey


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1826938 13f79535-47bb-0310-9956-ffa450edef68
2018-03-16 09:35:06 +00:00
Jacques Le Roux 84bc50b994 Fixed: Logout do not remove autoLogin
(OFBIZ-4959)

Logout method do not disable autoLogin functionality. 
Instead of that it just initializes autoLogin in session and request.

jleroux: this was also needed by OFBIZ-10206 "Security issue in Token Based 
Authentication". 
This creates a keep-autologin-cookie boolean attribute in the webapp element of 
the  ofbiz-component.xml, documented in ofbiz-component.xsd
This attribute is used to get the value from the ofbiz-component.xml files in a
new autoLogoutCleanCookies() LoginWorker method. This method is used not only 
when login out but also when login in. This to be sure that in every cases the 
cookies related to the webapps are removed.
For now only the ecommerce, ecomseo et webpos webapps are keeping and using 
their autologin cookies

Thanks: Roberto Benítez Monje for report and Taher for discussion and suggestion

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1824803 13f79535-47bb-0310-9956-ffa450edef68
2018-02-19 19:23:36 +00:00
Jacques Le Roux a4d20dfc52 Improved: Token Based Authentication
(OFBIZ-9833)

No functional change, removes TODOs that I recently 
(1 week ago in r1823324) put to myself to quickly check. 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1824260 13f79535-47bb-0310-9956-ffa450edef68
2018-02-14 16:40:19 +00:00
Jacques Le Roux f5ba435024 Completed: Security issue in Token Based Authentication
(OFBIZ-10206)

No functional change, just better syntax

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1823562 13f79535-47bb-0310-9956-ffa450edef68
2018-02-08 15:01:54 +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 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
Jacques Le Roux 4922cc9fbb Fixed: Fix the HttpServletRequestWrapper in ContextFilter.doFilter()
(OFBIZ-10167)

As reported by Deepak on dev ML the returned name should be a parameter and not 
enforced to "Authorisation"

This removes a wrong comment (no functional change)

Thanks: Deepak for bug report

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1821230 13f79535-47bb-0310-9956-ffa450edef68
2018-01-16 11:02:17 +00:00
Jacques Le Roux 4365984e18 Fixed: Fix the HttpServletRequestWrapper in ContextFilter.doFilter()
(OFBIZ-10167)

As reported by Deepak on dev ML the returned name should be a parameter and not 
enforced to "Authorisation"

Thanks: Deepak for bug report

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1821226 13f79535-47bb-0310-9956-ffa450edef68
2018-01-16 10:25:41 +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
Deepak Dixit 3812c6290a Reverted: Local changes committed at r#1818600
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818639 13f79535-47bb-0310-9956-ffa450edef68
2017-12-19 06:29:13 +00:00
Deepak Dixit d24c956bf9 Improved: Moved plugins js from images to common/js (OFBIZ-5776)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818600 13f79535-47bb-0310-9956-ffa450edef68
2017-12-18 18:16:09 +00:00
Nicolas Malin a02c5c7358 Implemented: Website can manage hidden webapp (OFBIZ-10088)
Improve RequestHandler.makeLink code to manage url generation with surcharge the webapp path.
When a websiteId is present and it have a webappPatch define, use it on the link generation.

Example of use :
You have a httpd serveur that listen on *.mydomaine.com and define virtualHost myEcommerce.mydomaine.com and myCatalog.mydomaine.com
myEcommerce.mydomaine.com is a reverse proxy to myEcommerce.mydomaine.com/ecommerce
myCatalog.mydomaine.com is a reverse proxy to myEcommerce.mydomaine.com/catalog

Natively, all works fine with some parameters on web.xml and controller.xml but each link return are setted like that myEcommerce.mydomaine.com/ecommerce, called by apache httpd to ofbiz by myEcommerce.mydomaine.com/ecommerce/ecommerce and translate by ofbiz by ERROR ecommerce request-map not found

To solve the situation, I extended WebSite entity with attribute webappPath, init to / for websiteId ecommerce ofbiz instance and /ecommerce for other websiteId liked to other ofbiz instance (dev, back) without apache httpd with limited reverse-proxy.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818494 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 16:47:18 +00:00
Michael Brohl 8208ea0af2 Improved: Added conditions for logging (info, warn) and made the cookies
Array more readable in the log (FindBugs warning).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818465 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 09:41:04 +00:00
Jacques Le Roux d1bdee2c6c Improved: Always check if debug verbose is on when using Debug.logVerbose()
(OFBIZ-10052)

This completes the work done so far by removing double check in cases not using 
brackets, like
if (Debug.verboseOn())
  if (Debug.verboseOn()) Debug.logVerbose()

Thanks: Michael for reporting this case I missed.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818445 13f79535-47bb-0310-9956-ffa450edef68
2017-12-16 19:00:19 +00:00
Jacques Le Roux 4928bf3ae5 Improved: Always check if debug verbose is on when using Debug.logVerbose()
(OFBIZ-10052)

This completes r1818075, there were still few cases, a last regexp search is 
never too much :)

Found 4 other loops with Strings concatenation, but who cares, it's only 
verbose logging...

There should not be anymore...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818077 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 22:37:16 +00:00
Jacques Le Roux 40e8be83df Improved: Always check if debug verbose is on when using Debug.logVerbose()
(OFBIZ-10052)

This completes r1818010, there were much more cases.
Also few tabs automatically replaced by spaces

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818020 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 14:11:38 +00:00
Jacques Le Roux e0d2057456 Improved: Always check if debug verbose is on when using Debug.logVerbose()
(OFBIZ-10052)

We discussed on this point: http://markmail.org/message/mplvusuqn7oshl4v 
and we agreed about better doing a check when using Debug.logVerbose().

I checked there are 300+ cases like that. Since it's an easy S/R 
This implements it

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818005 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 12:43:05 +00:00
Deepak Dixit 7e19de9966 Improved: Replace all delegator findByAnd and findOne method calling by EntityQuery methods (OFBIZ-10029)
Applied slightly modified patch, rearrange import properly, 
Thanks Suraj Khurana for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818003 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 12:03:17 +00:00
Deepak Dixit 63258e90f8 Reverted r#1817989, workign fine locally, reverted for now will check and commit again
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817998 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 10:42:32 +00:00
Deepak Dixit d1f85a7e5d Improved: Replace all delegator findByAnd and findOne method calling by EntityQuery methods (OFBIZ-10029)
Applied slightly modified patch, rearrange import properly, 
Thanks Suraj Khurana for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817989 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 09:21:33 +00:00
Deepak Dixit e8079f171d Improved: Use FlexibleLocation.resolveLocation to resolve the fop.path and fop.font.base.url (OFBIZ-9974)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1814708 13f79535-47bb-0310-9956-ffa450edef68
2017-11-09 08:25:36 +00:00
Jacques Le Roux a1c52626e1 Implemented: Token Based Authentication
(OFBIZ-9833)

Update the comments about ExternalServerJwtMasterSecretKey

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1814467 13f79535-47bb-0310-9956-ffa450edef68
2017-11-07 08:58:16 +00:00
Jacques Le Roux 88d1dc8008 Implemented: Token Based Authentication
(OFBIZ-9833)

Comment about production server

I thought it was obvious that you should not keep this file on a production
server after having changed the default value of 
ExternalServerJwtMasterSecretKey

Moreover we recommend to have the value of ExternalServerJwtMasterSecretKey 
dynamically generated during each build to increase security

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1814402 13f79535-47bb-0310-9956-ffa450edef68
2017-11-06 12:41:33 +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
Michael Brohl 4dd29160eb Improved: make utility function findWebsite public to be usable from
outside. This matches the pattern from other worker classes like 
PartyWorker.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1814279 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 11:50:07 +00:00
Jacques Le Roux 6fe07e9961 Implemented: Token Based Authentication
(OFBIZ-9833)

Fixes a typo

Thanks: Deepak on dev ML 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813732 13f79535-47bb-0310-9956-ffa450edef68
2017-10-30 08:19:08 +00:00
Jacques Le Roux 90a349b441 Implemented: Token Based Authentication
(OFBIZ-9833)

This works the same way than externalLoginKey but between 2 servers, 
not 2 webapps on the same server. 

The Single Sign On (SSO) is ensured by a JWT token, then all is handled as 
normal by a session on the reached server. The servers may or may not share a 
database but the loginUserIds on the 2 servers must be the same.

OOTB the JWT masterSecretKey is not properly initialised and can not be OOTB.
As we sign on on several servers, so have different sessions, we can't use the 
externalLoginKey way to create the JWT masterSecretKey.
The best way to create the JWT masterSecretKey is to use a temporary way to load 
in a static final key when compiling. This is simple and most secure. 
One of the proposed way is to use sed and uuidgen to modify the masterSecretKey 
value. The magic words here are TEMPORARY and FINAL!

I have not tested this between 2 servers yet, only locally where it works well.
I'll do after this commit between my local instance and the trunk demo.

Thanks: Nicolas for the sed ans uuidgen suggestion

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813679 13f79535-47bb-0310-9956-ffa450edef68
2017-10-29 11:02:00 +00:00
Michael Brohl 03175996f2 Fixed: X-Frame-Options configuration is not working
(OFBIZ-9891)

This fixes a bug where the configuration attribute in the view-map 
differs from what is read in the configuration handler. 

Aditionally,
a new option "none" is introduced. If it is set, no X-Frame-Options 
header will be set.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813276 13f79535-47bb-0310-9956-ffa450edef68
2017-10-25 12:56:01 +00:00
Jacques Le Roux 7e3754293a Implemented: Secure HTTP headers
(OFBIZ-6766)

Adds a Content Security Policy

To not block anything for the moment I have committed a simple most restrictive
Content-Security-Policy-Report-Only header

Then we can look at the issues using browsers tools (there are so much)
The next step is to report the errors (when there will not be too much) in the 
log using a report-uri
And ultimately to use OOTB the most simple and constraining policy, with 
exceptions of course (as ever).




git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812720 13f79535-47bb-0310-9956-ffa450edef68
2017-10-20 08:02:55 +00:00
Jacques Le Roux c174d69caa Reverted: Enhance cookies security
(OFBIZ-9865)

This reverts r1812540. It does not fit with OFBiz which then ask you to login
on any action!


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812623 13f79535-47bb-0310-9956-ffa450edef68
2017-10-19 11:47:09 +00:00
Jacques Le Roux 90a6bd3fa9 Implemented: Secure HTTP headers
(OFBIZ-6766)

Adds 
  the no-referrer-when-downgrade Referrer-Policy
  a comment about Public-Key-Pins-Report-Only
  a link to the related wiki page

This is my prior to last commit, before implementing a CSP policy which is quite
the stuff! Check yourself https://csp.withgoogle.com/docs/adopting-csp.html


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812609 13f79535-47bb-0310-9956-ffa450edef68
2017-10-19 10:00:48 +00:00