fuel9 / DisplayMonkey

Display Monkey digital signage solution
Other
127 stars 51 forks source link

WIP: Change Outlook frame to use MS Graph API #218

Open itsalexjones opened 1 year ago

itsalexjones commented 1 year ago

Following the deprecation of basic auth in the Exchange Web Services API, a solution is required for accessing calendar information using modern auth. This pull request completes that using the Microsoft Graph API.

In making these changes I have been focussed on our use case @global-broadcast-engineering, but have tried to keep existing behaviour intact, but it has not been tested yet. I am happy to take feedback on the code, and suggestions of minor changes over at #214 - but note that my scope is purely enabling our use case of meeting room booking and free/busy display. Anything requiring significant work that doesn't further that use case may be tricky to get completed.

Notable changes for operators of DisplayMonkey are:

Creating an Azure AD Application for Calendar Access

In order to authenticate users via Azure AD, we must register DisplayMonkey in our tenant. To do this:

  1. Log in to the Azure AD portal
  2. Go to Applications -> Application Registration
  3. Click 'New Registration'
  4. Enter a name, select 'This tenant only' and leave redirect URI blank.
  5. Click Register
  6. Once registered, go to the 'Authentication' tab and enable 'Allow public client flows'
  7. On the 'Overview' panel, copy the tenant and client ID to the web.config file

You will also need to provide consent for the accounts you have previously registered (or will register) for the scopes "User.Read", "Calendars.ReadWrite", "Calendars.ReadWrite.Shared", "MailboxSettings.Read". The application does not (currently) provide UI to do this, and the easiest way it to grant admin consent.

Things not explicitly tested - but theoretically working