(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
(OFBIZ-9449)
While working on an issue reported by Pierre Gaudin on user ML
https://s.apache.org/gDo3, here quoted:
I found another issue while testing: the port 8443 is missing in the URL used
underneath by the form reported by Pierre.
It was broken by OFBIZ-9206 where I removed the value of port.https in
url.properties.
It's not an issue if you set the value of port.https, or let it empty when
using a SSL certificate on a production server. But if you try locally
(localhost) then the URL misses the 8443 port.
Solution append 8443 as default secure port when using localhost
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1801094 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9206)
After my conclusions at OFBIZ-9240 I decided to reapply the changes and will
test on demos.
Because WebSiteProperties reuse the port initially found in the 1st login URL
I tried to replace locally
port.https=8443
by
port.https=
in url.properties (w/o SystemProperty) and did not face any issue but with
portOffset. This is due to how the WebSiteProperties class works and there is also
an easy fix: don't add twice the portOffset when it's build from the request,
and only then. Keep it as is when it's build from a WebSite GenericValue.
We then trust the user and don't rely on the request.
I also removed the deprecated RequestHandler.getDefaultServerRootUrl()
I think it was time...
Thanks: Pierre Smits for report
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1784930 13f79535-47bb-0310-9956-ffa450edef68
No functional change, cleaner code
........
No functional change, fixes a typo
........
Fixed: "Login and logout process in demos shows a certificate issue"
(OFBIZ-9206)
Also fixes "16.11 ofbizUrl include host+port and break some reverse-proxy/docker
setups"
(OFBIZ-9224)
It was an easy fix, I just imported
<SystemProperty systemPropertyId="port.https" systemResourceId="url"
systemPropertyValue=""/>
in trunk demo and all work perfectly.
I also tried to replace locally
port.https=8443
by
port.https=
in url.properties (w/o SystemProperty) and did not face any issue but with
portOffset. This is due to the WebSiteProperties class works and there is also
an easy fix: don't add twice the portOffset when it's build from the request,
and only then. Keep it as is when it's build from a WebSite GenericValue.
We then trust the user and don't rely on the request.
I also removed the deprecated RequestHandler.getDefaultServerRootUrl()
I think it was time...
Thanks: Pierre Smits and Leonard Lin for reports
........
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1784760 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9206)
Also fixes "16.11 ofbizUrl include host+port and break some reverse-proxy/docker
setups"
(OFBIZ-9224)
It was an easy fix, I just imported
<SystemProperty systemPropertyId="port.https" systemResourceId="url"
systemPropertyValue=""/>
in trunk demo and all work perfectly.
I also tried to replace locally
port.https=8443
by
port.https=
in url.properties (w/o SystemProperty) and did not face any issue but with
portOffset. This is due to the WebSiteProperties class works and there is also
an easy fix: don't add twice the portOffset when it's build from the request,
and only then. Keep it as is when it's build from a WebSite GenericValue.
We then trust the user and don't rely on the request.
I also removed the deprecated RequestHandler.getDefaultServerRootUrl()
I think it was time...
Thanks: Pierre Smits and Leonard Lin for reports
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1784549 13f79535-47bb-0310-9956-ffa450edef68
I did not even notice I committed this bunch of WIP stuff. I guess I clicked
somewhere while my machine was too buzy
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1781367 13f79535-47bb-0310-9956-ffa450edef68
I did not even notice I committed this bunch of WIP stuff. I guess I clicked
somewhere while my machine was too buzy
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1781366 13f79535-47bb-0310-9956-ffa450edef68
ExternalLoginKeysManager.getExternalLoginKey(...) method.
Minor refactoring of the getExternalLoginKey(...) method to make it more
friendly to unit tests.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1776138 13f79535-47bb-0310-9956-ffa450edef68
tokens from the LoginWorker class to a new class named ExternalLoginKeysManager.
Improved Javadocs in the new class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1775807 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9144)
This is the first commit to the above mentioned issue which fixes many javadoc
errors dispersed through the different components. The fixes are not
necessarily improvements to the javadocs but rather making them valid javadocs
to prevent reporting errors from gradle
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1774154 13f79535-47bb-0310-9956-ffa450edef68
.getAttribute() never returns null, it defaults to empty
Removes commented out import net.sf.json imports we use Jackson only (no license
issues)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1770543 13f79535-47bb-0310-9956-ffa450edef68
trying to unbox
(OFBIZ-8342)
site-conf.xsd doesn't define transaction-timeout as being mandatory but
ConfigXMLReader treats it as one and in the absence of the attribute an
exception is being thrown causing the application to break.
jleroux: I have slightly modified the patch, eventElement.getAttribute never
returns null, default to empty
Thanks: Valery Chenzo
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1770540 13f79535-47bb-0310-9956-ffa450edef68
conditional.xml to conditionalLabels.xml
DefaultMessages.xml to DefaultMessagesLabels.xml
EmailPassword.xml to EmailPasswordLabels.xml
Found while working on OFBIZ-8321
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1764261 13f79535-47bb-0310-9956-ffa450edef68