Setting up Microsoft Teams integration

Setting up Microsoft Teams integration

Use this guide to set up the Microsoft Teams integration for a Totara site.

To use Totara in Microsoft Teams, you need to create your own Microsoft Teams app, configure the required Microsoft Entra ID settings, configure the Microsoft Teams integration settings in Totara, then upload the generated app manifest to Microsoft Teams.

Before you start

You will need access to

Requirement

Needed for

Requirement

Needed for

Totara Site Administrator access

Configuring the Microsoft Teams integration and downloading the app manifest

Microsoft Teams admin centre access

Allowing third-party or custom apps and uploading the generated app package

Microsoft Entra ID permissions to register applications

Creating the app registration used by Totara and Teams

Azure subscription

Required only if you want to use the conversational bot, messaging extension, or Teams notifications

HTTPS Totara site URL

Required for Teams, SSO, redirects, bot endpoints, privacy URLs, and manifest validation

Privacy policy and terms of use URLs

Recommended for the Teams app listing and Microsoft app configuration

Decide which features you need

The setup steps depend on which Teams features you want to enable.

Feature

Required?

What it provides

Extra setup required

Feature

Required?

What it provides

Extra setup required

Teams app / tabs

Yes

Allows users to access Totara from Microsoft Teams

Microsoft Entra app registration, Totara integration settings, Teams manifest upload

Single sign-on

Optional

Allows users to access Totara in Teams using their Microsoft Entra IDentity

Microsoft Entra authentication settings, API scope, Graph delegated permissions, Totara OAuth 2 configuration

Conversational bot

Optional

Enables bot-based Teams features (notifications, and messaging extension - see below)

Azure Bot resource, bot endpoint, Teams channel

Messaging extension

Optional

Allows users to search or share Totara content from Teams

Conversational bot setup

Teams notifications

Optional

Sends Totara notifications to Microsoft Teams

Conversational bot setup and Teams notifications enabled in Totara message outputs

Goal

Required steps

Goal

Required steps

Basic Teams app only

Steps 1, 2, 4, 5

Teams app with SSO

Steps 1, 2, 2a, 4, 5

Messaging extension / notifications

Steps 1, 2, 3, 4, 5

SSO + bot features

All steps

Sites and domains

Important: Totara must be available over HTTPS. Some Microsoft Teams and Microsoft Entra URLs, including privacy policy, redirect, SSO, and bot URLs, may fail if HTTP is used.

When configuring the Microsoft Teams integration, it is important to understand the difference between a domain and a site URL.

A Totara site can be installed in a subfolder on a domain.

Example:

Type

Example

Type

Example

Domain

www.totarasite.com

Totara site URL

https://www.totarasite.com/learn

Use the site URL when configuring URLs that point to Totara pages or endpoints, for example redirect URLs, logout URLs, and the bot messaging endpoint.

Use the domain when configuring the Microsoft Entra API scope, for example:

api://www.totarasite.com/[Application client ID]

Microsoft’s Teams SSO documentation requires the Application ID URI to use the fully qualified domain name for the app, followed by the app ID.


Setup guide

Step 1: Prepare the Microsoft Teams tenant

You can find out more about preparing your Microsoft 365 tenant in Microsoft's documentation or sign up for a Microsoft Teams account.

  1. Sign in to the Microsoft Teams admin centre admin.teams.microsoft.com.

  2. Go to: Teams apps > Manage apps

  3. Open: Actions > Org-wide app settings

  4. Check that your tenant allows the app type you are configuring. Depending on your tenant configuration, this may include allowing third-party apps, allowing custom apps, and allowing the relevant admins or users to upload custom apps.

    1. For most instances, checking “Allow third-party app” will suffice.

  5. Save your changes.

Accessing Manage apps in the Microsoft Teams admin dashboard.
Accessing Manage apps in the Microsoft Teams admin dashboard.

Step 2: Create an app registration in Microsoft Entra ID

  • Microsoft Entra ID was previously known as Azure Active Directory.

  • Microsoft recommends single-tenant app registrations for most internal organisation apps. For this Totara integration, use a single-tenant app unless you have a specific reason to support multiple Microsoft Entra tenants. Microsoft describes single-tenant apps as apps available only in the tenant where they are registered, while multitenant apps can be used across other Microsoft Entra tenants.

Register the app

  1. Sign in to the Azure portal https://portal.azure.com/.

  2. Go to App registrations

    1. Navigate to App registrations by locating it under Manage > App registrations in the left navigation blade within the tenant; by searching 'app registrations' from the search bar, or by navigating to More services > All services.

  3. Select New registration.

  4. Enter a name for the app.

    Example:

    Totara Microsoft Teams
  5. Under Supported account types, select:

    Accounts in this organizational directory only

    This is the recommended option for a customer-owned internal Teams app.

There are four choices for Supported account types supported with Totara:

  • Accounts in this organizational directory only (TENANTNAME only - Single tenant): This is the recommended choice for this integration and is required for configuring a bot

  • Accounts in any organizational directory (Any Microsoft Entra ID directory - Multitenant)

  • Accounts in any organizational directory (Any Microsoft Entra ID directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox): Users can also log in using their personal accounts

  • Personal Microsoft accounts only: Users can only log in using their personal account (e.g. @hotmail.co.uk)

Please note that the options including personal Microsoft accounts any personal accounts must be external users of your Microsoft Entra ID tenant. For more information please refer to Microsoft's documentation.

  1. Select Register.

  2. On the app overview page, copy and save the following values:

Value

Where it is used later

Value

Where it is used later

Application (client) ID

Totara Microsoft Teams integration settings.

Microsoft also recommends recording the Application (client) ID after registration because it uniquely identifies the application.

Directory (tenant) ID

Totara Microsoft Teams integration settings.

Complete the branding information

  1. In the app registration, go to the branding or properties area and complete the app information.

  2. Use values that match the Teams app you want users to see.

Field

Suggested value

Field

Suggested value

Name

The name of your Teams app

Logo

The same logo you plan to use in Totara’s Microsoft Teams settings

Home page URL

Your Totara site URL

Terms of service URL

Your organisation’s terms of use URL

Privacy statement URL

Your organisation’s privacy policy URL

  1. Save your changes.

Step 2a [Optional] - Configure Microsoft Single Sign-On

Complete this section only if you want users to sign in to Totara in Microsoft Teams using Microsoft single sign-on.

For additional information please see Microsoft's documentation.

If you select Personal Microsoft accounts only, or Accounts in any organizational directory and personal Microsoft accounts, Microsoft says to update the requestedAccessTokenVersion property in the app registration manifest to 2. See https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/authentication/tab-sso-register-aad#configure-access-token-version for more information.

This is not required for the recommended single-tenant option.

Teams SSO allows users who are already signed in to Teams with a Microsoft or Microsoft 365 account to access the app without signing in again, provided the app has been configured correctly in Microsoft Entra ID.

Add authentication URLs

  1. In the Microsoft Entra app registration, go to: Authentication

  2. Select Add a platform.

  3. Select Web.

  4. Add the redirect URI:

    https://[your.totara.site.url]/admin/oauth2callback.php

    If your Totara installation uses a different admin folder name, replace admin with your actual folder name.

  5. Add the logout URL:

    https://[your.totara.site.url]/totara/msteams/sso_logout.php
  6. Save your changes.

  7. Add another redirect URI:

    https://[your.totara.site.url]/totara/msteams/oidc_login.php
  8. Save your changes again.

Expose an API

  1. In the Microsoft Entra app registration, go to: Expose an API

  2. Select Add next to Application ID URI.

  3. Enter the Application ID URI in this format:

    api://[your.totara.domain]/[Application client ID]

    Example:

    api://www.totarasite.com/00000000-0000-0000-0000-000000000000

Important: Use the domain, not the full Totara site URL. For example, use www.totarasite.com, not www.totarasite.com/learn.

If Microsoft Entra ID displays an error when you enter the Application ID URI, open the app registration manifest and edit the value directly.

image-20260429-022213.png
  1. Save your changes.

Add the access scope

  1. In Expose an API, select Add a scope.

  2. Enter the following values:

Field

Value

Field

Value

Scope name

access_as_user

Who can consent

Admins and users

Admin consent display name

Teams can access the user's profile

Admin consent description

Allows Teams to call the app's web APIs as the current user.

User consent display name

Teams can access your user profile and make requests on your behalf

User consent description

Enable Teams to call this app's APIs with the same rights that you have.

State

Enabled

  1. Select Add scope.

Add authorised Teams client applications

In Expose an API, add the Teams client applications that are allowed to use this scope.

Add the following client IDs:

Teams client

Client ID

Teams client

Client ID

Teams desktop/mobile client

1fec8e78-bce4-4aaf-ab1b-5451cc387264

Teams web client

5e3ce6c0-2b1f-4285-8d4b-75ee78787346

Add Microsoft Graph delegated permissions

  1. In the app, go to: API permissions

  2. Select: Add a permission > Microsoft Graph > Delegated permissions

  3. Add the following permissions:

    email offline_access openid profile User.Read
  4. Save your changes.

  5. Select: Grant admin consent for [tenant name]

  6. Confirm the consent prompt.

Create a client secret

  1. Go to: Certificates & secrets

  2. Select New client secret.

  3. Enter a description.

  4. Choose an expiry period that matches your organisation’s security policy.

  5. Save the secret.

  6. Copy the Value (not ID) immediately.

Important: Microsoft only shows the client secret value once. Store it securely. You will need it when configuring the OAuth 2 service in Totara.


Step 3: Create an Azure Bot

Complete this section only if you want to use the messaging extension or Teams notifications.

The bot framework setup allows Teams to communicate with Totara through a bot endpoint.

Notifications for Microsoft Teams also need to be enabled in the message outputs.

Create the bot

  1. Sign in to the Azure portal https://portal.azure.com/ .

  2. Go to: Bot services

    Depending on your Azure portal layout, this may appear under Azure AI services, Applied AI services, or through search.

  3. Select Create.

  4. Choose Azure Bot.

  5. Complete the form.

Field

Value

Field

Value

Bot handle

A unique handle for your bot

Subscription

Your Azure subscription

Resource group

Select an existing group or create a new one

Location

Choose a region close to your Totara server

Pricing tier

Select the free F0 tier, if appropriate

Type of app

Single tenant

Creation type

Create new Microsoft App ID

  1. Select Review + create.

  2. Select Create.

  3. When deployment completes, select Go to resource.

Note: The bot handle is a unique identifier and cannot be changed after the bot is created.

Configure the bot profile

Optionally update the bot’s icon and display name.

Go to: Settings > Bot Profile

Update:

Field

Suggested value

Field

Suggested value

Icon

Your organisation or Totara app icon

Display name

The name users should see in Microsoft Teams

Configure the messaging endpoint

  1. Go to: Settings > Configuration

  2. Set the messaging endpoint to:

    https://[your.totara.site.url]/totara/msteams/botindex.php
  3. Select Apply.

The messaging endpoint is configured from the Azure Bot resource’s Configuration pane.

Enable the Microsoft Teams channel

  1. Go to: Settings > Channels

  2. Under Available channels, select Microsoft Teams.

  3. Read and accept the terms of service.

  4. Select the appropriate messaging environment.

    1. For most organisations this will be: Microsoft Teams Commercial

  5. Select Apply.

  6. Close the channel setup page.

Record the bot app ID and create a bot client secret

  1. In Azure, go to: App registrations

  2. Open the app registration created for the bot.

  3. Copy and save the Application (client) ID.

    You will use this as the Bot app ID in Totara.

  4. Go to: Certificates & secrets

  5. Delete any existing secret if required by your organisation’s process.

  6. Select New client secret.

  7. Enter a description.

  8. Choose an expiry period.

  9. Save the secret.

  10. Copy the Value immediately.

You will use this as the Client secret for Bot in Totara.


Step 4: Configure Microsoft Teams integration in Totara

Now configure the integration in your Totara site.

Configure OAuth 2 for SSO

Complete this subsection only if you are using Microsoft single sign-on.

  1. Sign in to Totara as a Site Administrator.

  2. Enable the OAuth 2 authentication plugin.

  3. Create a new Microsoft OAuth 2 service.

  4. Configure the service using the values from your Microsoft Entra app registration.

Totara setting

Value

Totara setting

Value

Client ID

Application (client) ID from the Microsoft Entra app registration

Client secret

Client secret value from the Microsoft Entra app registration

Require email verification

Choose according to your organisation’s authentication policy