Forum Discussion

karamem0's avatar
karamem0
Copper Contributor
May 28, 2024

Supports API-Key or X-Functions-Key in API-based message extension

Hi all,

I am tring to imprement a Teams app with API-based message extension. The backend of the API is Azure Funtions HTTP trigger and requires an API key. The API-based message extension supports the API key authentiation, but the key is sent as Bearer token (Authtorization header). Unfortunately, Azure Funtions does not supports Bearer token. Also I tried to include an OpenAPI security schemas, but it was ignored. Some other API (e.g. OpenAI Service) accepts an API key with API-Key header. I think it is not common method to send an API key with Bearer token. I think it is helpful that the users can specifiy the authencation method (by OpenAPI spec, maybe).

4 Replies

  • karamem0 - Could you please let us know what exactly you want to achieve here? Which functionality you want to be added/implemented?

    • karamem0's avatar
      karamem0
      Copper Contributor

      Prasad_Das-MSFT 

      My idea is Teams detects OpenAPI Security Schema when specified authType: apiSecretServiceAuth.

      OpenAPI Specification v3.0.1 | Introduction, Definitions, & More

       

      manifest.json

        "composeExtensions": [
          {
            "composeExtensionType": "apiBased",
            "authorization": {
              "authType": "apiSecretServiceAuth",
              "apiSecretServiceAuthConfiguration": {
                "apiSecretRegistrationId": "9xxxxb0f-xxxx-40cc-xxxx-15xxxxxxxxx3"
              }
            }

       

      swagger.json 

      "securitySchemes": {
        "apikeyheader_auth": {
            "type": "apiKey",
            "name": "X-Functions-Key",
            "in": "header"
        }
      }

       

Resources