WSO2 API Cloud provides the facility for users to share their applications and subscriptions with a specific group(s). Users can view and manage applications and subscriptions belonging to other users in the same group.
The API Cloud uses role names as the grouping entity. In order to enable sharing, a role name, as the group must be specified when creating an application. All users who have been assigned that role, will share the application and subscriptions which have that role name as the grouping entity, within the tenant domain.
Before you Begin
- The role used for grouping can be a new custom role created in the API Cloud or an existing role . Make sure that you have two users who are members of the role you wish to use as a the grouping entity.
- Create two users and add them to a common role. This tutorial will be using Sam@mailinator.com , Joe@mailinator.com and a custom role 'AppSharingRole' as the role for grouping.
- Deploy the sample API from one user's account.
Let's get Started.
- Go to http://cloud.wso2.com and check if you have two users with a shared role. For this tutorial I will be using users Sam@mailinator.com, Joe@mailinator.com & the role 'AppSharingRole'.
Sign in as Joe@mailinator.com and add application 'JoeTestSharedApplication'. Make sure to add the role 'AppSharingRole' in the Groups field. Please note that the role 'AppSharingRole' is a role used in the tutorial for better explanation. Alternatively, an already existing role or a custom role can be used for this purpose.
- Verify the group is correctly set, when viewing the application details.
- In a separate browser session, Sign in to the store as Sam@mailinator. com.
Click on Applications and view all Applications. Notice the shared application being listed. Sam can view Joes application that Joe shared with the 'AppSharingGroup'.
- Click on API's and select PhoneVerification API.
- When the 'Application' drop down is expanded the shared application will be visible. Subscribe the API to the shared application.
- Verify the Subscription by clicking "View All Subscriptions" on the pop up box that appears. Alternatively, click on Applications, select 'JoeTestSharedApplication' and click on the subscriptions tab.
- Note that at this point, Sam cannot create keys for the application because Sam is not the owner of the application. Once Joe generates the keys once, the keys will be visible to Sam. Sam will then be able to regenerate keys for the application.
- Now, from Joe@malinitaor.coms API store, click on Applications. Notice that the subscription count is shown. The subscriptions are shared.
- Click on the Application "JoeTestSharedApplication" and click on the "Subscriptions" tab.
- Generate Keys for the application.
- Now from Sam's store view check the visibility of the keys. Sam can also regenerate keys for the shared application.
- You have shared Applications and Subscription among users within the same tenant having the same role assigned.