You can enable the following configurations for applications:
Enable SaaS mode for applications
You can enable SaaS mode for your web applications by configuring the
web.xml file relevant to each web application. Further, you can share the web application among multiple tenants from this configuration.
To enable SaaS mode for a web application:
- Open the
web.xmlfile of your web application from the archive directory.
carbon.enable.saasparameter should be added to enable SaaS mode. The value you give for this parameter will depend on the use case. For example, consider that a tenant wants to share its web application with
wso2.com, foo.comand 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:
If all tenants
bar.comcan access this application, enter the following:
bar.com(all users) can access this application, enter the following:
If only Sam and admin in
foo.comtenant and all users in
bar.comtenant can access this application, enter the following:
Enabling CORS for applications
If required, you can enable CORS (cross origin resource sharing) for web applications by adding the CORS filter to the
web.xml file as shown in the following example.
The parameters used in this example are as follows:
cors.allowed.originsparameter is used to specify the web domains that should be allowed to share resources with the web application. The domain names should be specified as parameter values. If the parameter value is set to '*' as shown above, or if this parameter is not used at all, resource sharing will be allowed for all origins (all web domains).
cors.allowed.methodsparameter is used to specify the type of requests for which CORS should be enabled. You can list the allowed methods as parameter values.