Contact Free trial Login

Configuring the Spring Security Manager

Mule Runtime Engine versions 3.5, 3.6, and 3.7 reached End of Life on or before January 25, 2020. For more information, contact your Customer Success Manager to determine how you can migrate to the latest Mule version.

Use Spring Security 3.0 as a Security Manager inside of Mule. You can use any of the library’s security providers such as JAAS, LDAP, CAS (Yale Central Authentication service), and DAO. For more information on the elements you can configure for a Mule security manager, see Security Manager Configuration Reference.


The following example illustrates how to configure a single security provider on Mule, in this case an in-memory database of users. To configure the provider, we set up a <user-service> element and the <authentication-manager> to which Mule delegates.

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns=""

        <mule-ss:delegate-security-provider name="memory-provider" delegate-ref="authenticationManager" />

      <ss:authentication-manager alias="authenticationManager">
          <ss:user-service id="userService">
            <ss:user name="ross" password="ross" authorities="ROLE_ADMIN" />
            <ss:user name="anon" password="anon" authorities="ROLE_ANON" />

Adding Spring Security References

To make Spring security work, you need to add XML schema declarations to your Mule App. Notice the above example includes the following references inside the root XML element:

Make sure you include these references, they are important and Studio does not add them automatically.

Security Filters

Security filters can be configured on an object to either authenticate inbound requests or attach credentials to outbound requests. For example, to configure an HTTP basic authorization filter on an HTTP connector, you would use the following connector security filter:

<inbound-endpoint address="http://localhost:4567">
    <mule-ss:http-security-filter realm="mule-realm"/>

When a request is received, the authentication header is read from the request and authenticated against all security providers on the Security Manager. If you only want to validate on certain providers, you can supply a comma-separated list of security provider names.

<inbound-endpoint address="http://localhost:4567">
    <mule-ss:http-security-filter realm="mule-realm" securityProviders="default,another"/>

The realm is an optional attribute required by some servers. You only need to set this attribute if required by the server on the other end.

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub