Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You The content given here explains how you can enable the following some configurations for applications:your application. The instructions given here are applicable to all applications (generic web applications, JAX-RS/JAX-WS applications and Jaggery application) that are deployable in WSO2 AS. 

Table of Contents
maxLevel3
minLevel3

...

You can enable SaaS mode for your web applications by configuring the META-INF/context.xml file relevant to each web application. This configuration allows the web application to be shared among multiple tenants.

To enable SaaS mode for a web application:

  1. Open the META-INF/context.xml file of your web application from the archive directory.
  2. Update the following section to enable/disable SaaS mode for your application:

    Code Block
    <Context>
    	<Realm className="org.wso2.carbon.tomcat.ext.realms.CarbonTomcatRealm" 
          enableSaaS="true" 
          saasRules="*"  />
    </Context>
    • The enableSaaS parameter can be set to "true" or "false". The value you give for this parameter will depend on the use case. 

    • The saasRules parameter controls how the web application should be shared among tenants. For example, consider that a tenant wants to share its web application with wso2.com, foo.com and bar.com. You can change the parameter value according to the use case as shown below.

      If all tenants can access this application, enter the following:

      Code Block
      <Context>
      	<Realm className="org.wso2.carbon.tomcat.ext.realms.CarbonTomcatRealm" 
            enableSaaS="true" 
            saasRules="*"  />
      </Context>

      If all tenants except foo.com and bar.com can access this application, enter the following:

      Code Block
      <Context>
      	<Realm className="org.wso2.carbon.tomcat.ext.realms.CarbonTomcatRealm" 
            enableSaaS="true" 
            saasRules="*, !foo.com,!bar.com"  />
      </Context>

      If only foo.com and bar.com (all users) can access this application, enter the following:

      Code Block
      <Context>
      	<Realm className="org.wso2.carbon.tomcat.ext.realms.CarbonTomcatRealm" 
            enableSaaS="true" 
            saasRules="foo.com,bar.com"  />
      </Context>

      If only Sam and admin in foo.com tenant and all users in bar.com tenant can access this application, enter the following: 

      Code Block
      <Context>
      	<Realm className="org.wso2.carbon.tomcat.ext.realms.CarbonTomcatRealm" 
            enableSaaS="true" 
            saasRules="foo.com;users=Sam,admin,bar.com"  />
      </Context>

...