SwitchYardRunner based unit tests fail when run with enabled security policies

Solution Unverified - Updated -

Issue

  • It has been observed that as soon as developers enable security policies on a SwitchYard component then all the SwitchYardRunner based unit tests in the SwitchYard project (e.g. quickstarts/switchyard/demos/policy-security quickstart) start failing with this exception.
...
09:31:10,118 INFO  [org.switchyard.common.camel.SwitchYardCamelContext] Route: direct:{urn:com.sample.service:fast-order-service:1.0}TestBeanService started and consuming from: Endpoint[direct://%7Burn:com.sample.service:fast-order-service:1.0%7DTestBeanService]
09:31:10,119 ERROR [org.switchyard.security] SWITCHYARD014200: authenticate LoginException: No LoginModules configured for other
javax.security.auth.login.LoginException: No LoginModules configured for other
...
  • These are the security policies which were enabled inside switchyard.xml.
...
    <sca:component name="TestBeanService">
      <camel:implementation.camel requires="authorization">
        <camel:java class="com.sample.service.TestBeanServiceRoute"/>
      </camel:implementation.camel>
      <sca:service name="SimpleWebService" requires="clientAuthentication confidentiality">
        <sca:interface.wsdl interface="..."/>
      </sca:service>
    </sca:component>
...
    <sy:securities>
      <sy:security rolesAllowed="NewAdmin"/>
    </sy:securities>
....
  • What is the correct way to run a test in an authenticated, authorized and confidential fashion (without making a copy of the switchyard.xml for tests)?

Environment

  • Red Hat JBoss Fuse Service Works (FSW)
    • 6.0.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content