|
Re: Secure whole application [message #1219132 is a reply to message #1219082] |
Mon, 02 December 2013 09:54 |
|
On 01.12.2013 15:29, Dave Smith wrote:
> I would like to make my RAP application and transport only accessible by
> https. I would like to use the feature in the servlet spec transport
> guarantee Confidential. Then jetty (paxweb) should automatically
> redirect any http requests to https. Possible ? or am I going at this
> the wrong way..
AFAIK, you can register a servlet filter with paxweb. The servlet filter
could redirect http:// URLs to https://. Would this be an option?
Best regards,
Ralf
--
Ralf Sternberg
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
|
|
Re: Secure whole application [message #1220135 is a reply to message #1219727] |
Tue, 10 December 2013 03:27 |
Dave Smith Messages: 34 Registered: July 2009 |
Member |
|
|
We that still does not work because regardless of the HttpConext you pass in to
ApplicationLauncher.launch you wrap it up in a HttpContextWrapper and therefore it is not the same HttpContext. The hack I used to make it work (very ugly)....
ApplicationReference ref = applicationLauncher.launch(this, httpService, null, null, System.getProperty("java.io.tmpdir"));
Field f = ref.getClass().getDeclaredField("httpContext");
f.setAccessible(true);
HttpContext ctx = (HttpContext) f.get(ref);
org.ops4j.pax.web.service.WebContainer.WebContainer container = bundleContext.getService(bundleContext.getServiceReference(WebContainer.class));
container.registerFilter(new HttpToHttpsFilter(), new String [] { "/portal" , "/portal/*"}, null, null, ctx);
Basically I am grabbing the wrapped context and then manually registering the filter against it.I would suggest ApplicationReference expose a getHttpContext() method or event better expose it farther down in the Application interface so it could be called when in the ApplicationConfiguration.configure().
|
|
|
|
Powered by
FUDForum. Page generated in 0.03971 seconds