Digital Developer Conference: a FREE half-day online conference focused on AI & Cloud – North America: Nov 2 – India: Nov 9 – Europe: Nov 14 – Asia Nov 23 Register now

Close outline
  • United States
IBM?
  • Site map
IBM?
  • Marketplace

  • Close
    Search
  • Sign in
    • Sign in
    • Register
  • IBM Navigation
IBM Developer Answers
  • Spaces
    • Blockchain
    • IBM Cloud platform
    • Internet of Things
    • Predictive Analytics
    • Watson
    • See all spaces
  • Tags
  • Users
  • Badges
  • FAQ
  • Help
Close

Name

Community

  • Learn
  • Develop
  • Connect

Discover IBM

  • ConnectMarketplace
  • Products
  • Services
  • Industries
  • Careers
  • Partners
  • Support
10.190.13.195

Refine your search by using the following advanced search options.

Criteria Usage
Questions with keyword1 or keyword2 keyword1 keyword2
Questions with a mandatory word, e.g. keyword2 keyword1 +keyword2
Questions excluding a word, e.g. keyword2 keyword1 -keyword2
Questions with keyword(s) and a specific tag keyword1 [tag1]
Questions with keyword(s) and either of two or more specific tags keyword1 [tag1] [tag2]
To search for all posts by a user or all posts with a specific tag, start typing and choose from the suggestion list. Do not use a plus or minus sign with a tag, e.g., +[tag1].
  • Ask a question

Error 403: Resource must be accessed with a secure connection try again using an HTTPS connection.

270006QRW4 gravatar image
Question by Holger Kache  (51) | Mar 20, 2014 at 09:31 AM libertyibmcloud

I'm trying to use an existing .war but can't figure out how to deal with session authentication. The app uses a servlet filter that would normally redirect me to the authentication service also running on Liberty.

Now on bluemix I'm able to push my Liberty app but don't understand how to bind the authentication service. As a result I keep getting 403 responses and tried variations of

https://app.ng.bluemix.net or https://user:password@app.ng.bluemix.net

What do I have to do to get my session authentication working on Bluemix?

lmsurprenant

People who like this

  1
Comment
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

4 answers

  • Sort: 
060000YCS5 gravatar image

Answer by Rohit Kelapure (1001) | Mar 31, 2014 at 01:26 AM

I am going to post a more detailed answer later. Here is the shorter version ...

<user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint>

will NOT work with Cloud Foundry since this forces the transport to be https to the app instance. SSL is terminated at the Proxy tier (DataPower/HAProxy) in Cloud Foundry deployments.

To overcome this limitation your app will need to be slightly re-architected using some of the techniques illustrated here

  1. http://creechy.wordpress.com/2011/08/22/ssl-termination-load-balancers-java/
  2. http://www.javaworld.com/article/2074039/java-web-development/mix-protocols-transparently-in-web-applications.html
  3. http://download.springer.com/static/pdf/400/bbm%253A978-1-4302-4156-0%252F1.pdf?auth66=1396416011_7c0fd23f3a17e494b25d1ee75da20e4a&ext=.pdf

Hope this helps. Rohit

Comment
Ram Vennam

People who like this

  1   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
270002J07U gravatar image

Answer by Benjamin Ratiarisolo (67) | Aug 27, 2014 at 09:36 AM

It seems that using "plain" Websphere Liberty security constraints defined in your application's web.xml file is now working fine both locally and when deployed to Bluemix.

I just tried it, and http traffic on my deployed app is indeed redirected to https.

To sum things up, your server.xml file should looks like (SSL and application security feature enabled, keystore and certifacate defined):

<server description="Websphere Liberty">
<featureManager>
<!-- ... -->
<feature>ssl-1.0</feature>
<feature>appSecurity-2.0</feature>
<!-- ... -->
</featureManager>
<!-- ... -->
<httpEndpoint id="defaultHttpEndpoint" host="localhost" httpPort="9080" httpsPort="9443" />
<keyStore id="defaultKeyStore" password="{xor}xxxxxxxxx="/>
</server>

And in my case my application web.xml file looks as follows:

   <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<display-name>Blah blah blah</display-name>
<security-constraint>
<display-name>HTTPS Redirect Security Constraint</display-name>
<web-resource-collection>
<web-resource-name>myapp</web-resource-name>
<description>HTTPS redirect</description>
<url-pattern>/foo</url-pattern>
<url-pattern>/bar</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
</web-app>

Comment
lmsurprenant

People who like this

  1   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
060000YCS5 gravatar image

Answer by Rohit Kelapure (1001) | Mar 20, 2014 at 11:13 AM

Holger,

Before answering this we need more information about your security configuration. What does your existing server.xml security configuration look like ?

-cheers, Rohit

Comment

People who like this

  0   Show 1   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
270006QRW4 gravatar image Holger Kache (51)   Mar 20, 2014 at 11:39 AM 0
Share

Hi Rohit,

Thanks for the response. I'm posting 3 files for you, the server.xml I have on Bluemix, the server.xml for the local Liberty profile, and the application.xml. Please find them at

https://gist.github.com/anonymous/1b669aea8cda955842bc

Regards, Holger

100000A84G gravatar image

Answer by Tom_McManus (91) | Mar 26, 2014 at 03:10 PM

Rohit -- I am in the same boat. This works well on a local, but when I push to BlueMix I get "Error 403: Resource must be accessed with a secure connection try again using an HTTPS connection." in the browser. I understand Bluemix is front ended by Datapower and the header is suppose to be replaced, but not sure if I did everything correctly.

My server.xml file: <server description="new server">

<!-- Enable features --> <featureManager> <feature>jsp-2.2</feature> <feature>appSecurity-1.0</feature> <feature>localConnector-1.0</feature> <feature>ssl-1.0</feature> </featureManager>

<httpEndpoint host="localhost" httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>

<applicationMonitor updateTrigger="mbean"/>

<webApplication id="BluemixWeb" location="BluemixWeb.war" name="BluemixWeb"> <application-bnd> <security-role name="all"> <special-subject type="ALL_AUTHENTICATED_USERS"></special-subject> </security-role> </application-bnd> </webApplication> <basicRegistry> <user password="tompassword" name="tom"></user> </basicRegistry> <keyStore password="mysecret"></keyStore>

</server>

My webApp code index.jsp

<%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <html> <head> <title>Who Am I?></title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> </head> <body> You are <%=request.getUserPrincipal().getName() %> </body> </html>

My web.xml file

<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee &lt;a href=" http:="" java.sun.com="" xml="" ns="" javaee="" web-app_3_0.xsd""="">http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>BluemixWeb</display-name> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <security-role> <role-name>all</role-name> </security-role> <security-constraint> <web-resource-collection> <web-resource-name/> <url-pattern>/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>all</role-name> </auth-constraint> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint> </web-app>

URL: http://samplesecureapp.ng.bluemix.net/BluemixWeb

StdErr.log:

[ERROR ] CWWKS9113E: The SSL port is not active. The incoming http request cannot be redirected to a secure port. Check the server.xml file for configuration errors. The https port may be disabled. The keyStore element may be missing or incorrectly specified. The SSL feature may not be enabled. [ERROR ] CWWKS9113E: The SSL port is not active. The incoming http request cannot be redirected to a secure port. Check the server.xml file for configuration errors. The https port may be disabled. The keyStore element may be missing or incorrectly specified. The SSL feature may not be enabled. [ERROR ] CWWKS9113E: The SSL port is not active. The incoming http request cannot be redirected to a secure port. Check the server.xml file for configuration errors. The https port may be disabled. The keyStore element may be missing or incorrectly specified. The SSL feature may not be enabled.

Comment

People who like this

  0   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

Follow this question

No one has followed this question yet.

Answers

Answers & comments

Related questions

ManagedScheduledExecutorService 1 Answer

Issues with status of the Bluemix app - Went down automatically 2 Answers

Liberty Spring web app with SQLDB JNDI not found 1 Answer

Using jaxrs 2.0 with Jersey on IBM WebSphere Liberty Buildpack 1 Answer

jbatch needs authorization-roles in server.xml in liberty 1 Answer

  • Contact
  • Privacy
  • IBM Developer Terms of use
  • Accessibility
  • Report Abuse
  • Cookie Preferences

Powered by AnswerHub

Authentication check. Please ignore.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • API Connect
  • Analytic Hybrid Cloud Core
  • Application Performance Management
  • Appsecdev
  • BPM
  • Blockchain
  • Business Transaction Intelligence
  • CAPI
  • CAPI SNAP
  • CICS
  • Cloud Analytics
  • Cloud Automation
  • Cloud Object Storage
  • Cloud marketplace
  • Collaboration
  • Content Services (ECM)
  • Continuous Testing
  • Courses
  • Customer Experience Analytics
  • DB2 LUW
  • Data and AI
  • DataPower
  • Decision Optimization
  • DevOps Build
  • DevOps Services
  • Developers IBM MX
  • Digital Commerce
  • Digital Experience
  • Finance
  • Global Entrepreneur Program
  • Hadoop
  • Hybrid Cloud Core
  • Hyper Protect
  • IBM Cloud platform
  • IBM Design
  • IBM Forms Experience Builder
  • IBM Maximo Developer
  • IBM StoredIQ
  • IBM StoredIQ-Cartridges
  • IIDR
  • ITOA
  • InformationServer
  • Integration Bus
  • Internet of Things
  • Kenexa
  • Linux on Power
  • LinuxONE
  • MDM
  • Mainframe
  • Messaging
  • Node.js
  • ODM
  • Open
  • PartnerWorld Developer Support
  • PowerAI
  • PowerVC
  • Predictive Analytics
  • Product Insights
  • PureData for Analytics
  • Push
  • QRadar App Development
  • Run Book Automation
  • Search Insights
  • Security Core
  • Storage
  • Storage Core
  • Streamsdev
  • Supply Chain Business Network
  • Supply Chain Insights
  • Swift
  • UBX Capture
  • Universal Behavior Exchange
  • UrbanCode
  • WASdev
  • WSRR
  • Watson
  • Watson Campaign Automation
  • Watson Content Hub
  • Watson Marketing Insights
  • dW Answers Help
  • dW Premium
  • developerWorks Sandbox
  • developerWorks Team
  • Watson Health
  • More
  • Tags
  • Questions
  • Users
  • Badges