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.
Once the new account is created, you should be able to see the new tenant (directory) as highlighted below:
- Navigate to the Azure Active Directory admin center and login using a personal account (aka: Microsoft Account) or Work or School Account.
-
Select Azure Active Directory in the left-hand navigation, then select App registrations under Manage. Select New registration.
-
Enter data for your application Redirect URI - ngrok/expose url for DEV, or production url if web app is live. https://{URL}/oauth/microsoft.
Copy the App (Client) ID into .env
MICROSOFT_AZURE_APP_CLIENT_ID
variable
After you are done with checking all necessary permissions, click Add permissions button
Next you should see the permissions you have granted the access to. On that screen, select Grant Admin Consent for Default Directory
- 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.
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
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.