How to integrate my Teams account?
Overview
To authenticate, you will need to provide the following information:
- Client ID
- Tenant ID
- Client Secret
- Username
- Password
Step 1: Login to Microsoft Entra (Azure AD) Portal
- Go to Microsoft Azure
- Sign in with the Microsoft account that has access to your Teams tenant (typically an admin account).
Step 2: Register Your Application
- Once logged in, go to "Microsoft Entra ID" from the left menu.
- Select "App registrations".
- Click on "+ New registration".
Fill the registration form:
- Name: Give your app a name (e.g., Unizo Teams App)
- Supported account types: Choose
- Accounts in this organizational directory only (for single tenant)
- Redirect URI: Leave blank or add one if using OAuth login (e.g., https://localhost for testing)
- Click Register.
Step 3: Get the Client ID and Tenant ID
- After the app is registered, you will land on the app overview page.
- Copy the following:
- Application (client) ID → This is your Client ID
- Directory (tenant) ID → This is your Tenant ID
Step 4: Generate Client Secret
- Go to Certificates & secrets in the left sidebar
- Under Client secrets, click + New client secret
- Add:
- Description: (e.g., Teams App Secret)
- Expires: Select an expiration duration (e.g., 6 months or 1 year)
- Click Add
- Copy the Value immediately — this is your Client Secret
Step 5: Get Username and Password
- Use the email address and password of a user who has access to Microsoft Teams in your organization.
- This should be a valid, licensed Microsoft 365 user.
- These credentials will be used to authenticate the user via OAuth 2.0 Resource Owner Password Credentials (ROPC) grant type (only if your tenant allows it).
Required Microsoft Graph Permissions
Permissions | Type |
---|---|
Directory.Read.All | Application / Delegated |
Organization.Read.All | Application / Delegated |
Channel.Read.All | Application / Delegated |
Channel.Read.All | Application / Delegated |
ChannelMessage.Read.All | Delegated only |
ChannelMessage.Send | Delegated only |
Important:
- Application permissions are used for background/server-to-server apps (client credentials flow).
- Delegated permissions are used when a signed-in user is involved (OAuth authorization code or ROPC).
ChannelMessage.Send
andChannelMessage.Read.All
are not allowed in application-only context for real-time message interaction.
How to Add these Permissions
- Go to Azure Portal
- Navigate to Microsoft Entra ID → App registrations
- Open your app → Go to API Permissions
- Click + Add a permission
- Select:
- Microsoft Graph
- Choose:
- Delegated permissions for interactive apps
- Application permissions for background apps
- Add the required permissions listed above
- Click Grant admin consent (needed for Application permissions)