# 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 Value**

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

---

#### **1️⃣ Sign in to Azure Portal**

Open: [https://portal.azure.com<svg class="block h-[0.75em] w-[0.75em] stroke-current stroke-[0.75]" data-rtl-flip="" fill="currentColor" height="20" viewbox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"></svg>](https://portal.azure.com/)Sign 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.png](https://help.cloudex.app/uploads/images/gallery/2026-06/scaled-1680-/bIGimage.png)](https://help.cloudex.app/uploads/images/gallery/2026-06/bIGimage.png)

---

#### **3️⃣ Create a new App Registration**

1. Left menu: **App registrations**
2. Click **New registration**

[![image.png](https://help.cloudex.app/uploads/images/gallery/2026-06/scaled-1680-/v39image.png)](https://help.cloudex.app/uploads/images/gallery/2026-06/v39image.png)

[![image.png](https://help.cloudex.app/uploads/images/gallery/2026-06/scaled-1680-/sKGimage.png)](https://help.cloudex.app/uploads/images/gallery/2026-06/sKGimage.png)

<div id="bkmrk-url-type-must-be-%22we"><div>URL type must be "Web" NOT "Single page application"</div><div>Looks like beter to register as Single tenant. If you register as multi tenant then can be so than you need to enter CLOUDEX <span data-olk-copy-source="MessageBody">MpnId 7086574</span> </div><div>  
</div><div>**Fill the form:**</div></div><div id="bkmrk-field-value-name-clo"><div><table class="w-fit min-w-(--thread-content-width)" data-end="1440" data-start="1145"><thead data-end="1162" data-start="1145"><tr data-end="1162" data-start="1145"><th data-col-size="sm" data-end="1153" data-start="1145">Field</th><th data-col-size="md" data-end="1162" data-start="1153">Value</th></tr></thead><tbody data-end="1440" data-start="1181"><tr data-end="1239" data-start="1181"><td data-col-size="sm" data-end="1192" data-start="1181">**Name**</td><td data-col-size="md" data-end="1239" data-start="1192">CLOUDEX TMS Email Integration (or any name)</td></tr><tr data-end="1335" data-start="1240"><td data-col-size="sm" data-end="1270" data-start="1240">**Supported account types**</td><td data-col-size="md" data-end="1335" data-start="1270">✔️ **Accounts in any organizational directory (multitenant)**</td></tr><tr data-end="1440" data-start="1336"><td data-col-size="sm" data-end="1355" data-start="1336">**Redirect URI**</td><td data-col-size="md" data-end="1440" data-start="1355">Select **Web** → Enter your redirect:   
`https://my.cloudex.app/<strong>YourCompanyCode</strong>/Services/Office365Callback.aspx`

1\) Replace `<strong>YourCompanyCode</strong>` with your web app CompanyCode

2\) Redirect URL is case-sensitive

</td></tr></tbody></table>

</div></div>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.png](https://help.cloudex.app/uploads/images/gallery/2026-06/scaled-1680-/cxSimage.png)](https://help.cloudex.app/uploads/images/gallery/2026-06/cxSimage.png)

<div id="bkmrk-copy-them-and-save."><div>Copy them and save.</div></div>You already have **2/3 values**.

---

#### **5️⃣ Create Client Secret**

Side menu → **Certificates &amp; 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**

[![image.png](https://help.cloudex.app/uploads/images/gallery/2026-06/scaled-1680-/Finimage.png)](https://help.cloudex.app/uploads/images/gallery/2026-06/Finimage.png)

[![image.png](https://help.cloudex.app/uploads/images/gallery/2026-06/scaled-1680-/jzGimage.png)](https://help.cloudex.app/uploads/images/gallery/2026-06/jzGimage.png)

<div id="bkmrk-important-%E2%9A%A0%EF%B8%8F"><div>IMPORTANT ⚠️</div></div>**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 Value**

---

#### **6️⃣ Add Required API Permissions**

Side menu → **API permissions**

Click:

- **Add a permission**
- **Microsoft Graph**
- **Delegated permissions**

Search + select:

✔ `Mail.ReadWrite`✔ `Mail.Send`  
✔ `Mail.SendShared`  
✔ `offline_access`✔ ``User.Read``  
<span style="color: rgb(224, 62, 45);">!!!</span> If email sending does not work, then add also following permissions  
✔ `email`  
✔ `openid`✔ `profile`

Then click **Add permissions**.  
Then click **Grant admin consent**.

[![image.png](https://help.cloudex.app/uploads/images/gallery/2026-06/scaled-1680-/o6Fimage.png)](https://help.cloudex.app/uploads/images/gallery/2026-06/o6Fimage.png)

Can be in new interface need to choose Microsoft Graph API

[![image.png](https://help.cloudex.app/uploads/images/gallery/2026-06/scaled-1680-/bJiimage.png)](https://help.cloudex.app/uploads/images/gallery/2026-06/bJiimage.png)

---

#### **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**

[![image.png](https://help.cloudex.app/uploads/images/gallery/2026-06/scaled-1680-/K1Uimage.png)](https://help.cloudex.app/uploads/images/gallery/2026-06/K1Uimage.png)

<div id="bkmrk--16"><div>  
</div></div>#### 🎉 DONE — Values ready to use

You now have everything:

<div id="bkmrk-parameter-where-to-f"><div><table class="w-fit min-w-(--thread-content-width)" data-end="3236" data-start="2994"><thead data-end="3026" data-start="2994"><tr data-end="3026" data-start="2994"><th data-col-size="sm" data-end="3006" data-start="2994">Parameter</th><th data-col-size="sm" data-end="3026" data-start="3006">Where to find it</th></tr></thead><tbody data-end="3236" data-start="3059"><tr data-end="3116" data-start="3059"><td data-col-size="sm" data-end="3074" data-start="3059">**TenantId**</td><td data-col-size="sm" data-end="3116" data-start="3074">App → Overview → Directory (tenant) ID</td></tr><tr data-end="3176" data-start="3117"><td data-col-size="sm" data-end="3132" data-start="3117">**ClientId**</td><td data-col-size="sm" data-end="3176" data-start="3132">App → Overview → Application (client) ID</td></tr><tr data-end="3236" data-start="3177"><td data-col-size="sm" data-end="3196" data-start="3177">**ClientSecret**</td><td data-col-size="sm" data-end="3236" data-start="3196">App → Certificates &amp; Secrets → **Value**</td></tr></tbody></table>

</div></div>#### Problem solution

In case you have any problems sending out emails from CLOUDEX TMS or Ozols you can run **"Diagnose and solve problems"** tool

[![image.png](https://help.cloudex.app/uploads/images/gallery/2026-06/scaled-1680-/fssimage.png)](https://help.cloudex.app/uploads/images/gallery/2026-06/fssimage.png)