This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Publishing Web Apps to Multiple Tenant Stores

App publishers are allowed to advertise their Web app to external stores. When a tenant publisher publishes the Web app, it is published to that tenant’s own app store by default. Each tenant can configure a set of external stores where the app can be advertised. The app publisher can push the app to those configured external stores. However, when users try to view the advertised app, users are redirected to the original publisher's store. 

  1. Log in to the App Manager admin console (https://<Server Host>:9443/carbon) as admin and select Browse under the Resources menu.
  2. Navigate to the /_system/governance/appmgt/applicationdata/external-app-stores.xml file.
  3. Click Edit as Text and change the <ExternalAPPStores> element of each external app store to which you want to publish apps. For example,

    <ExternalAPPStores>
       <StoreURL>http://localhost:9763/store</StoreURL>
       <ExternalAPPStore id="Store1" type="wso2" className="org.wso2.carbon.appmgt.impl.publishers.WSO2ExternalAppStorePublisher">
    
           <DisplayName>Marketing Dept</DisplayName>
    
           <Endpoint>http://localhost:9763/publisher</Endpoint>
    
           <Username>mkd@mk.com</Username>
    
           <Password>xxxxx</Password>
    
       </ExternalAPPStore>
    
       <ExternalAPPStore id="Store2" type="wso2" className="org.wso2.carbon.appmgt.impl.publishers.WSO2ExternalAppStorePublisher">
    
           <DisplayName>Engineering</DisplayName>
    
           <Endpoint>http://localhost:9763/publisher</Endpoint>
    
           <Username>admin@eng.com</Username>
    
           <Password>xxxx</Password>
    
       </ExternalAPPStore>
    
    </ExternalAPPStores>

    Note the following in the configuration above:

    Element

    Description

    <ExternalAPPStores id="" type="" className=””>

    id: The external store identifier, which is a unique value.

    type: Type of the store. This can be a WSO2-specific app store or an external one. You can have any value for type.

    className: This is the class used to publish the app to external stores. WSO2ExternalAppStorePublisher is used to publish to external tenant stores. By extending the ExternalAppStorePublisher interface, you can write your own publisher class.

    <StoreURL>

    The URL of the app store of the current App Manager deployment. This is the URL to the app in the original publisher's store. Apps that are published to external stores are redirected to this URL.

    <DisplayName>

    The name of the store that is displayed in the Publisher UI.

    <Endpoint>

    The URL of the app store.

    <Username> and <Password>

    Credentials of a user who has permissions to create and publish apps.

  4. Create and publish a Web app from the Publisher. Go to the Overview tab of the published app and click the External Stores tab. All the configured stores appear here based on the display name given in the configuration. 
  5. Select one or more stores and click Save to publish the app to the selected external stores. 
  6. If you want to remove an already published app from any external store, then deselect that external store and click Save.
  • The publish to external stores option is available to apps that are public (not restricted by roles).
  • The publish to external stores option is available to apps that are in the Published state.
  • It is not possible to change the lifecycle state of the original app from Published to any other state when that app is published to any external stores. 
  • If the original app is deleted, apps in the external stores are removed automatically.

When an app is published to the external store as an advertised app, only a registry artifact is created (no DB entries, synapse configs, or SSO providers). Therefore, the advertised app in the external store cannot be edited from the Publisher. Also, it is only possible to publish, unpublish and delete a lifecycle for the advertised app in the external store. If an advertised app is deleted from the external store, the app in the original store is still marked as Published. In order to mark it as un-published, select and update the store.