Forum Discussion

  • kirylkalasouski -

    Yes, it is possible to use the OAuth client described on the developer portal for API-based Teams message extensions. The OAuth client allows you to support external or third-party OAuth providers, such as Google, GitHub, LinkedIn, and Facebook, using the updated authenticate() API. This API supports external OAuth providers by adding specific parameters to the authentication process.

    Support Third Party OAuth Providers - Teams | Microsoft Learn

     

    For more detailed guidelines on implementing OAuth for API-based message extensions, you can refer to the API-based Message Extension Guidelines

     

     

    • kirylkalasouski's avatar
      kirylkalasouski
      Copper Contributor

      Thank you Sayali-MSFT ! What should be specified in the App manifest then? Developer portal generates the following configuration which is invalid for 1.17 schema. I was not able to find any intructions for this in the provided articles. Thanks!

       

      • Sayali-MSFT's avatar
        Sayali-MSFT
        Icon for Microsoft rankMicrosoft

        kirylkalasouski -

        To ensure your OAuth client for API-based message extension is valid for the 1.17 schema, you need to update your app manifest accordingly. Here are the key elements you should include in your manifest:

        1. Schema Reference: Ensure your manifest references the correct schema URL:

          {
            "$schema": "https://developer.microsoft.com/json-schemas/teams/v1.17/MicrosoftTeams.schema.json",
            "manifestVersion": "1.17",
            ...
          }
          
        2. Authorization Property: Add the authorization property under composeExtensions to define the type of authentication for your application:

          {
            "composeExtensions": [
              {
                "authorization": {
                  "authType": "OAuth",
                  "oauth2": {
                    "clientId": "YOUR_CLIENT_ID",
                    "scopes": ["SCOPE1", "SCOPE2"],
                    "redirectUri": "YOUR_REDIRECT_URI"
                  }
                },
                ...
              }
            ],
            ...
          }
          
        3. Bot ID: Ensure you have the botId specified under composeExtensions:

          {
            "composeExtensions": [
              {
                "botId": "YOUR_BOT_ID",
                ...
              }
            ],
            ...
          }
          
        4. Commands: Define the commands your message extension will support:

          {
            "composeExtensions": [
              {
                "commands": [
                  {
                    "id": "exampleCmd1",
                    "title": "Example Command",
                    "type": "query",
                    "context": ["compose", "commandBox"],
                    "description": "Command Description; e.g., Search on the web",
                    "initialRun": true,
                    "fetchTask": false,
                    "parameters": [
                      {
                        "name": "keyword",
                        "title": "Search keywords",
                        "inputType": "choiceset",
                        "description": "Enter the keywords to search for",
                        "value": "Initial value for the parameter",
                        "choices": [
                          {
                            "title": "Title of the choice",
                            "value": "Value of the choice"
                          }
                        ]
                      }
                    ]
                  }
                ],
                ...
              }
            ],
            ...
          }
          

        For more detailed guidelines, you can refer to the App Manifest Reference

         and the API-based Message Extension Guidelines

         

Resources