------------------------------------------------------------------------
r1824803 | jleroux | 2018-02-19 20:23:36 +0100 (lun., 19 févr. 2018) | 18 lines
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/branches/release17.12@1824804 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1824260 | jleroux | 2018-02-14 17:40:19 +0100 (mer., 14 févr. 2018) | 1 line
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/branches/release17.12@1824261 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1823324 | jleroux | 2018-02-06 14:17:57 +0100 (mar., 06 févr. 2018) | 26 lines
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/branches/release17.12@1823325 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1822882 | jleroux | 2018-02-01 16:27:17 +0100 (jeu., 01 févr. 2018) | 7 lines
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/branches/release17.12@1823316 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1821600 | jleroux | 2018-01-19 09:39:05 +0100 (ven., 19 janv. 2018) | 11 lines
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/branches/release17.12@1823311 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1821230 | jleroux | 2018-01-16 12:02:17 +0100 (mar., 16 janv. 2018) | 9 lines
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/branches/release17.12@1821231 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1821226 | jleroux | 2018-01-16 11:25:41 +0100 (mar., 16 janv. 2018) | 1 line
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/branches/release17.12@1821229 13f79535-47bb-0310-9956-ffa450edef68
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
(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
(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
(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
(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
(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
(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
(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
(OFBIZ-6655)
Programmatically replaces the web.xml <session-config> declarations and uses
the @WebListener annotation to start the process. This avoid to duplicates
things everywhere in web.xml files. Since the web.xml files have precedence
on annotations, the setting can be easily overridden when necessary.
Now that we also use HTTPS in ecommerce the ecommerce session cookie is
also secured.
I also noted that we had 8 weird <session-timeout> declarations:
in solr component: <session-timeout>2</session-timeout>
in themes: <session-timeout>1</session-timeout>
Also in Rainbowstone we lacked the <cookie-config> and <tracking-mode>
declarations. I think it's not good.
I resolve these points by simply removing the <session-config> in web.xml files
of themes and Solr.
Thanks: Pradhan Yash Sharma for review
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1811041 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-6655)
This is somehow related with OFBIZ-6655 because it's there that Deepak reverted
r1719762 (actually r1719939). It was right to do so at r1722379 for
RequesHandler but not for the other files. Because it now does not handle
security for cookies which are not session cookies. It's minor but still a risk,
notably for autoLoginCookie
This reapplies r1719762 for the other files to make other than session cookies
secure. I will not backport
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1809687 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9240)
ecomseo trunk and stable (R16)
Get to https://demo-trunk.ofbiz.apache.org/ecomseo/
or https://demo-stable.ofbiz.apache.org/ecomseo/
login => main page logged in
logout => main page, not logged in
login => main page logged in
Use the "Not you" link => 404
Refresh (F5 key) get you to the main page, not logged in
So it works almost correctly but you need a refresh (F5 key) for the "Not you"
link, not sure why yet.
It"s the same locally with OFBIZ-9206 fixed*, w/ or w/o portoffset ecommerce
trunk and stable (R16)
Get to https://ofbiz-vm2.apache.org:8443/ecommerce
or https://ofbiz-vm2.apache.org:18443/ecommerce
login => blank page (no 404 in access log)
Refresh (F5 key) get you to the main page, logged in
logout => blank page (no 404 in access log)
Refresh (F5 key) get you to the main page, not logged in
login => blank page (no 404 in access log)
Refresh (F5 key) get you to the main page, logged in
use the "Not you" link => blank page (no 404 in access log)
Refresh (F5 key) get you to the main page, not logged in
So it works almost correctly but you need a refresh (F5 key) between in the
3 cases, not sure why yet.
It's the same locally with OFBIZ-9206 fixed, w/ or w/o portoffset
Rohit:
The sequencing order of ControlFilter and ContextFilter is causing this problem.
I tried to swap the order in case ecommerce but changing the sequence will not
work because other filters(like ContentUrlFilter, CatalogUrlFilter) depends on
the context prepared by ContextFilter.
The issue is like when we are doing chaining of request using request-redirect
than one request attribute(FORWARDED_FROM_SERVLET) set to TRUE from
ControlServlet. In case of ecommerce ContextFilter run before ControlFilter
which copies all the attribute from parent request to redirect request and
when execution reaches the ControlFilter for the redirect request than request
will fail to hit the servlet due to the code present
at line 126(ControlFilter.java).
To fix this problem I removed the code which copies all the attribute from
parent request to redirect request because this thing is already taken care in
the RequestHandler.
Thanks: Rohit and Jacopo for the analysis and the fix
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805677 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9571)
No functional change.
We read at http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html :
<<Using the integer fields in this class (such as ROUND_HALF_UP) to represent
rounding mode is largely obsolete; the enumeration values of the RoundingMode
enum, (such as RoundingMode.HALF_UP) should be used instead.>>
That's an easy global replacement. But it also needs to import the RoundingMode
class. It was 26 files so I decided to rather clean all the imports in all files
with the help of Eclipse.
This is a 1st step. I will need to closely look at 2 special class: UtilNumber
and Calculate.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804953 13f79535-47bb-0310-9956-ffa450edef68