Skip to content

Office365 Module

Justin Angel edited this page Aug 19, 2020 · 11 revisions

The office365_api module makes use of the O365 package.

Azure App Registration

Note: The author is not an expert on implementing Azure "apps", or Azure anything for that matter. It behooves the reader to consider these configurations insecure. This is an exemplary "just f****ng" work configuration -- probably the most common type observed with Azure.

An Azure App has to be registered for the sending domain in order for Postage to send emails on its behalf. This guidance has been largely adapted from the O365 package page and should assist with the registration process.

  1. As an administrative user, using your domain credentials at Microsoft's Admin Portal.
  2. Visit this URL to access RegisteredApps
  3. Click New registration
  4. In the Register an application form, apply the following configurations
    • Name - Enter Postage
    • Supported account types - Select Accounts in any organizational directory (Any Azure AD directory - Multitenant)
    • Redirect URI (optional) - Select Web from the drop down and enter this URI: https://login.microsoftonline.com/common/oauth2/nativeclient
  5. Submit the form and take note of the Application (client) ID value for future reference
  6. Click Certificates & secrets from the left-hand menu
  7. Click the plus (+) symbol beside "New client secret"
  8. In the pop-up window, supply Postage as the name and select a proper lifetime for the token. One year should suffice without issue.
  9. Copy the value of the new secret. Note: This step is critical as the value will not be visually displayed a second time and is required for authentication.
  10. Click API Permissions in the left-hand menu
  11. Click Add a permission
  12. Select Microsoft Graph > Delegated Permission
  13. Enter "mail" into the search filter, enable the following, and click *Add permissions:
Mail.Send
Mail.Send.Shared
  1. Click Add a permission (yes, again)
  2. Select Microsoft Graph > Application permissions
  3. Enter "mail into the search filter, enable the following, and click Add permissions
Mail.Send
  1. Back at the API permissions page, click the check beside Grant admin consent for <project name> and select "yes"

Assuming the following components have been recorded for authentication, Postage should now be able to send mail on your behalf:

  • Application (client) ID (See steps 1-5)
  • Client secret value (See steps 6-9)

Authentication

Authentication is a bit funky.

Clone this wiki locally