5

If i publish one of my SharePoint add-ins in Office Store, would it be possible for me to control who can download the add-in? I mean to target the the add-in to specific tenants somehow.

I know some of the answers would be just to add the add-in in the tenants own App Catalog, and this could be the solution, but I'm still curious about my question above.

My goal is to centrally control the add-in regarding pushing new add-in updates to the tenants using it, instead of pushing the update to each tenants App Catalog.

UPDATE!

Thinking loud, a better solution would be to configure a corporate App Catalog where I put all of my add-ins and then specify which tenants can have access to this catalog, a sort of an own smaller Office Store. Would that be possible?

3
  • I think that corporate app catalogs are only available to the tenant they belong to, so you would not be able to grant another tenant access to your app catalog.
    – wjervis
    Commented Jan 20, 2016 at 19:23
  • I get doubtful when you say you "think", could you provide some references? Commented Jan 22, 2016 at 16:04
  • Any info provided on app catalogs only mentions making the apps available internally. I don't have time to search for proof of otherwise. See this on what an app catalog is. If you still have doubts, then try what you propose. The worse that will happen is you will fail. If it works, then share and spread the knowledge.
    – wjervis
    Commented Jan 22, 2016 at 16:23

1 Answer 1

0

One of the approaches could be to implement Remote Event Receiver, specifically Add-in Installed (AppInstalled) event and have it dip it in database which will contain the allowed Tenant Ids, Urls. A sample code of the event handler would be:

public SPRemoteEventResult ProcessEvent(SPRemoteEventProperties properties)
{
    SPRemoteEventResult result = new SPRemoteEventResult();
    string TenantDomain = properties.AppEventProperties.HostWebFullUrl.Host;    

    switch (properties.EventType)
    {
        case SPRemoteEventType.AppInstalled:
            if(IsTenantAllowed(TenantDomain))
            {
                result.Status = SPRemoteEventServiceStatus.Continue;
            }
            else
            {
                result.ErrorMessage = "This tenant is not allowed to install this app, please contact [email protected] to get access.";
                result.Status = SPRemoteEventServiceStatus.CancelWithError;
            }
            break;
        default:
            break;
    }
    return result;
}

You need to implement below method such that is returns true if the domain is found in allowed Tenants.

bool IsTenantAllowed(string TenantDomain)

For more info on RER implementation, you can refer this

2
  • I will definitely give this a look! Let me come back to you as soon as i have tested it in a suitable context.. Commented Feb 23, 2016 at 8:23
  • I have to apologize as I have not yet have the time to test your suggestion! Please let me come back to you. Commented Mar 17, 2016 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.