2
votes

I'm working on integrating Office 365 APIs into a web application that has different URLs for each organization (e.g. there could be an installation at http://organization1.com and an installation at http://organization2.com). Right now, for development, we have an Office 365 developer tenant and an associated Azure site. On Azure, we registered an application with a local URL as the return URL (e.g. http://localhost), and we use the Client ID and secret to authenticate calls to the API.

However, once we deploy this into production, we're going to have instances of the web application at many different URLs (one per organization), and organizations will have their own Office 365 account and associated Azure account. Does this mean that organizations will need to add the application themselves into their Azure directory, or is there a way for us to create an application that can be used with arbitrary tenants and return URLs?

What would be the best practice for a situation like this?

1

1 Answers

1
votes

There are two approaches:

  1. get the customer to create the application in Azure AD and get the client ID and secret key and store it in your app somewhere...either in the UI and securely store it somewhere based on the loaded tenant

OR

  1. in Visual Studio change the setting (can do this in the Azure AD application in your tenant) to support "multiple Organizations". This is set when you go to Add Connected Service and select App Properties...