8

Stackexchange says this is a subjective question but I don't think it is. I am just trying to discover feasibility here.

After a lot of reading online, I was able to successfully convert an app that was originally built using auto-hosted model to provider-hosted. I currently have it working in one sharepoint online site collection with the content being provided from an azure website.

The steps to accomplish this involved registering the app/client id & secret on the sharepoint site where the app was to be deployed (using appregnew.aspx), and then putting these values into the web.config of the provider hosted part of the app.

Now, say I want to publish this same app to another sharepoint online site. Would I need to create a completely different azure website (or other provider) for the new tenant? Since the azure web site contains the app/client ID and secret, I don't understand how this can be accomplished, since I assume that each sharepoint online site will need to generate and register a new id & secret for the provider.

Is the only way to accomplish this by packaging the app for the office store?

Update:

I suppose I could keep a database of app/client ID's and secrets on the provider / azurewebsites side, keyed by SPHostUrl, and get at multiple tenants' auth info that way. Am testing this out now. However, the AppManifest would still have to change for each publish, since it will be different for different tenants. I suppose that's not too bad, and we might be able to automate that on a build server using some powershell...

1 Answer 1

6

Well as for me you can always register the app for the first time on one of the tenants, use the registration data in Azure and in .app file and then, when installing the app on other tenants instead of clicking on generate button in appregnew.aspx, simply paste the client id and client secret you have generated when installing the app for the first time. Have tested it in Office365<->Azure environment and it is working.

This way you use the same Azure site and the same .app file for every subsequent installation.

7
  • Really? So you can TELL sharepoint online which appID and secret to use for authorizing? I will have to try this out first time I am able to...
    – danludwig
    Commented Nov 19, 2014 at 18:51
  • 1
    Yes, have done it a couple of times. Now trying to achieve the same effect on-premise but suprisingly it is not as easy as I thought;)
    – Ciamas
    Commented Nov 19, 2014 at 19:01
  • So I know this is probably a bit off-topic, but are you trying to do it with STS or OAuth on-prem? I read you could make on-prem use OAuth with an STS proxy, but have not tried it yet...
    – danludwig
    Commented Nov 19, 2014 at 23:45
  • With STS, and this kinda doesn't work. Do you have a link about it?
    – Ciamas
    Commented Nov 20, 2014 at 11:02
  • 1
    This is all I have: msdn.microsoft.com/en-us/library/dn155905.aspx. By the way, I tried your suggestion yesterday and on the site that did not generate the app Guid / secret, and even though I registered it using appregnew.aspx, when deployed the app kept getting Invalid issuer or signature errors.
    – danludwig
    Commented Nov 20, 2014 at 13:08

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.