script-lab-2017
script-lab-2017 copied to clipboard
Helper and infrastructure to enable a snippet to do authentication with Azure AD


- https://dev.office.com/docs/add-ins/develop/auth-external-add-ins
See also https://github.com/OfficeDev/script-lab/issues/85
The feature is now partially in-place, but very much alpha level. In particular:
- It lacks a security review.
- It does not cache tokens (i.e., it pops a dialog every time), nor auto-renew them.
- It makes no use of existing auth libraries.
In order to integrate OfficeJsHelpers -- which would fix all three of the above issues -- we would need to make sure that it has (or be expanded to include) :
- Only store tokens in-memory, not in local storage
- Allow to substitute strings instead of assuming English.
There would also be some (several hours? a day?) work to actually integrate OfficeJsHelpers.
Also, should consider if can make it a non-Script-Lab-only feature (i.e., use OfficeJsHelpers just as normal, without having a special ScriptLab.getAccessToken). Or at least have a very clearly documented bit of code that maps the proprietary ScriptLab.getAccessToken to the underlying OfficeJsHelpers documentation.
Note: Counter-point to the above -- we also want to enable just-in-time registration via AAD... so there may need to be ScriptLab-specific functionality there after all. Though perhaps we could build it in as more of a clientID fetching (e.g.,
authenticator.endpoints.registerAzureADAuth(await ScriptLab.getAzureADClientId()).