<div dir="ltr"><div>I am trying to secure parts of site (so a user can log in securely and then later see certain restricted information based on the credentials).</div><div><br></div><div>Ideally only login page needs to be "forced" to https, the rest of the site should work with plain http. Since the JSESSIONID is not shared between http and https once the user is logged in he should navigate all of the site via https.</div>
<div><br></div><div>Setup is that Apache handles SSL, and communicates with Tomcat through mod_ajp. OpenCms 8.5.0</div><div><br></div><div>This seems to be the recommended setting in opencms-system.xml:</div><div><br></div>
<div>(1)</div><div><site server="<a href="http://something.com">http://something.com</a>" uri="/sites/default/" ></div><div> <secure server="<a href="https://something.com">https://something.com</a>" exclusive="true" error="false" /></div>
<div></site></div><div><br></div><div>There is a folder inside /sites/default/ which have the "secure" attribute set to true in the VFS, inside which there is a login page.</div><div><br></div><div>This kind of works - browser is forced to https version when hitting a page inside that folder, but links on the page that points to pages outside of the secure folder are all unsecure. Hence once the user clicks away from the login page he appears as being logged out as the secured JSESSIONID is gone once on a http page (and that is a good thing).</div>
<div><br></div><div>If the user enters https manually in the browser address field then he again gets the JSESSIONID and appears logged in, </div><div><br></div><div>So what I would like to happen is that once a user accesses via the https scheme, URLs should all remain https. It does not seem that this is possible (at least I haven't found a setting doing that). Setting exclusive=false above is not an option since on the login-page https must be enforced.</div>
<div><br></div><div>(2)</div><div><site server="<a href="https://something.com">https://something.com</a>" uri="/sites/default/" /> </div><div><br></div><div>does allow one to do either secure og unsecure browsing, but then there is no enforcing for the login page (actually it throws an exception because the secure-tag is not defined while the attribute states secure is true).</div>
<div><br></div><div>The option then is to go secure for the entire site (which would be ok). The quick solution would be to set the secure attribute on the /site/default/ folder, but - given (1) configuration example with the secure-tag defined - it states " There is no secure server configured for the current site." - seems a bit odd though stricly speaking the Site-selector is "/" in order to actually set the attribute on /sites/default/.</div>
<div><br></div><div>So there is the option of setting secure on all content (files and foldes) in the /sites/default/ folder. </div><div><br></div><div>If it is all https all the time then I guess I can get the same effect by using (2) configuration and then have Apache force any non-https to https.</div>
<div><br></div><div>Have I overlooked any options?</div><div><br></div>/Claus
</div>