Versions Compared

Key

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

...

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

To enable SaaS mode for a web application:

  1. Open the webMETA-INF/context.xml file of your web application from the archive directory.The carbon.enable.saas parameter should be added to enable SaaS mode
  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

    . For
    • 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-param> <param-name>carbon.enable.saas</param-name> <param-value>*</param-value> </context-param>
    • <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-param> <param-name>carbon.enable.saas</param-name> <param-value>
    • <Context>
      	<Realm className="org.wso2.carbon.tomcat.ext.realms.CarbonTomcatRealm" 
            enableSaaS="true" 
            saasRules="*, !foo.com,!bar.
    com</param-value>
    • com"  />
      </
    context-param>
    • Context>

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

      Code Block
    <context-param>
    • <Context>
      
    <param-name>carbon.enable.saas</param-name> <param-value>foo
    • 	<Realm className="org.wso2.carbon.tomcat.ext.realms.CarbonTomcatRealm" 
            enableSaaS="true" 
            saasRules="foo.com,bar.
    com</param-value>
    • com"  />
      </
    context-param>
    • 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-param> <param-name>carbon.enable.saas</param-name> <param-value>foo
    • <Context>
      	<Realm className="org.wso2.carbon.tomcat.ext.realms.CarbonTomcatRealm" 
            enableSaaS="true" 
            saasRules="foo.com;users=Sam,admin,bar.
    com</param-value>
    • com"  />
      </
    context-param>
    • Context>

Enabling CORS for applications

...