Skip to main content

Office365: HOW TO GET TenantId, ClientId and ClientSecret

If you use Microsoft office 365 for email sending. Your company Microsoft admin need to get following settings from Azure AD Application 

  • Directory (Tenant) ID

  • Application (Client) ID

  • Client Secret

These three values are required for integrating CLOUDEX TMS with Microsoft Graph using OAuth2.


1️⃣ Sign in to Azure Portal

Open:
 https://portal.azure.comSign in with a Microsoft 365 Global Admin or Application Administrator account.


2️⃣ Open “Microsoft Entra ID” (Azure AD)

Left menu → Microsoft Entra ID
(or search “Entra ID” in the top search bar)

image-1764595464188.png

https://learn.microsoft.com/en-us/entra/identity/devices/media/manage-device-identities/devices-azure-portal.png
https://learn.microsoft.com/en-us/azure/cost-management-billing/manage/media/find-tenant-id-domain/azure-active-directory-overview.png

3️⃣ Create a new App Registration

  1. Left menu: App registrations

  2. Click New registration

image-1764595545977.png

image-1764595721522.png

https://learn.microsoft.com/en-us/entra/identity-platform/media/quickstart-register-app/portal-03-app-reg-02.png
https://learn.microsoft.com/en-us/azure/healthcare-apis/media/register-application-one.png

Fill the form:

Field Value
Name CLOUDEX TMS Email Integration (or any name)
Supported account types ✔️ Accounts in any organizational directory (multitenant)
Redirect URI Select Web → Enter your redirect: https://my.cloudex.app/YourCompanyCode/Services/Office365Callback.aspxhttps://my.cloudex.app/office365/callback

Click Register.


4️⃣ Get the Tenant ID and Client ID

After creation, you will be redirected to the app’s Overview page.
Here you will see:
✔ Directory (Tenant) ID
✔ Application (Client) ID

image-1764595919838.png

https://learn.microsoft.com/en-us/azure/digital-twins/media/how-to-create-app-registration/client-id-tenant-id.png
https://learn.microsoft.com/en-us/azure/healthcare-apis/media/register-application-three.png

Copy them and save.

You already have 2/3 values.


5️⃣ Create Client Secret

Side menu → Certificates & secrets

  1. Click New client secret

  2. Enter a name: CLOUDEX Secret

  3. Choose expiration:

    • 6 months (not recommended)

    • 12 months

    • 24 months (recommended)

    • Or “Custom”

  4. Click Add

https://i.sstatic.net/HXKfc.png
https://learn-attachment.microsoft.com/api/attachments/138981-image.png?platform=QnA

IMPORTANT ⚠️

Copy the Client Secret VALUE immediately.
You will never be able to see it again later.

Store it securely (Azure Key Vault, password manager, etc).

Now you have:

  • ClientId

  • TenantId

  • ClientSecret


6️⃣ Add Required API Permissions

Side menu → API permissions

Click:

  • Add a permission

  • Microsoft Graph

  • Delegated permissions

Search + select:

Mail.Send
User.Read
offline_access

Then click Add permissions.

Then click Grant admin consent.

https://i.stack.imgur.com/Cpji8.png
https://learn-attachment.microsoft.com/api/attachments/214709-2022-06-24-173538.png?platform=QnA

7️⃣ Final Check: Authentication Settings

Side menu → Authentication

Ensure:

✔ Your redirect URI is correct
✔ “Allow public client flows” is OFF
✔ “Access tokens” and “ID tokens” are ON

https://learn.microsoft.com/en-us/entra/identity-platform/media/application-registration-best-practices/redirect-uri.png
https://i.sstatic.net/o3VwU.png

🎉 DONE — Values ready to use

You now have everything:

Parameter Where to find it
TenantId App → Overview → Directory (tenant) ID
ClientId App → Overview → Application (client) ID
ClientSecret App → Certificates & Secrets → Value