Skip to content

Instantly share code, notes, and snippets.

@opejovic
Last active March 29, 2023 18:05
Show Gist options
  • Save opejovic/4103747683e2599eb2f1a31580c0f840 to your computer and use it in GitHub Desktop.
Save opejovic/4103747683e2599eb2f1a31580c0f840 to your computer and use it in GitHub Desktop.
Microsoft Azure / Outlook Setup

Since you are connected to the Microsoft Services tenant as a standard user with restricted access, you cannot perform all the admin access. To perform administrative actions, you must have administrative access to the tenant.

For this purpose, you need to create your own tenant. When you create a new tenant, you by default become the Global Administrator of the new tenant to get all access in that tenant.

To create a new tenant, access https://azure.microsoft.com/en-us/free/ to create a free Azure account.

image

Once the new account is created, you should be able to see the new tenant (directory) as highlighted below:

image

  1. Navigate to the Azure Active Directory admin center and login using a personal account (aka: Microsoft Account) or Work or School Account.

image

  1. Select Azure Active Directory in the left-hand navigation, then select App registrations under Manage. Select New registration. image

  2. Enter data for your application Redirect URI - ngrok/expose url for DEV, or production url if web app is live. https://{URL}/oauth/microsoft. image

Copy the App (Client) ID into .env MICROSOFT_AZURE_APP_CLIENT_ID variable

image

  1. After creating your APP, go to Authentication image

  2. Now we need to add API permissions

image

![image](https://user-images.githubusercontent.com/20000869/203534071-b606acdc-4650-49c5-8cd4-8cc2554c0c1f.png)

Check all OpenId permissions image

Check Calendar Permissions image

Check User.Read Permission image

After you are done with checking all necessary permissions, click Add permissions button image

Next you should see the permissions you have granted the access to. On that screen, select Grant Admin Consent for Default Directory image

  1. Time to create a password for our app (A secret string that the application uses to prove its identity when requesting a token. Also can be referred to as application password.) Do note that these passwords have expiration date. Max expiration date that can be set is 24 months, but 6 months is recommended.

image

Client secret values cannot be viewed, except for immediately after creation. Be sure to save the secret when created before leaving the page. (Save the secret value (password) to .env MICROSOFT_AZURE_APP_CLIENT_PASSWORD, and save the secret id to MICROSOFT_AZURE_APP_CLIENT_SECRET_ID

image


Env variable APP_URL needs to be changed to either a dev link (the ngrok tunel), or production url of the site, if app is in production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment