Versions Compared

Key

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

...

  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>
Note

If you have not configured SaaS for your application as explained above, you will be warned with the following message when the application is invoked: "To enable SaaS mode for the webapp, "<webapp-name>", configure the CarbonTomcatRealm in META-INF/context.xml".

Enabling CORS for applications

...