microsoft / botbuilder-dotnet

Welcome to the Bot Framework SDK for .NET repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using .NET.
https://github.com/Microsoft/botframework
MIT License
864 stars 480 forks source link

Failed to invoke task module from hero card - Malformed AAD token or required field not found #6734

Closed AdamJachocki closed 5 months ago

AdamJachocki commented 5 months ago

Version

4.19.3

Describe the bug

It worked earlier and suddenly it stopped <-- this is very important. Our application sends a message on chat during meeting. This message is in form of HeroCard:

var card = new HeroCard()
{
    Title = "Helo",
    Subtitle = "Subtitle",
    Text = "Text",
    Buttons = new List<CardAction>()
    {
        new TaskModuleAction("Verify" new { action = BotMessageActions.Verify })
    }
};

When user clicks "verify" button on this hero card, a popup is opened but instead of our application being called, there is a error message: "Could not connect with application. Try again later".

When I tried to do it inside web teams, I was able to track more things. So, there is an invoke request that seems to be send to Teams after clicking the button, with payload:

{
    "name": "task/fetch",
    "messageType": "RichText/Media_Card",
    "value": {
        "data": {
            "action": "Verify",
            "type": "task/fetch"
        },
        "context": {
            "theme": "dark"
        }
    },
    "imdisplayname": "My name",
    "userAadToken": "eyJ0e...rest of token",
    "serverMessageId": "1706531054597",
    "clientMessageId": "2456007715220591101",
    "conversation": {
        "id": "19:meeting_OTIxZmEyYzMtYWFlZi00OTI2LTkwYjEtZGNlYmE2OWM5YjNk@thread.v2"
    }
}

And the response is (code: 400)

{
    "errorCode": 0,
    "message": "<BadSyntax>Malformed AAD token or required field not found",
    "standardizedError": {
        "errorCode": 201,
        "errorSubCode": 1,
        "errorDescription": "<BadSyntax>Malformed AAD token or required field not found"
    }
}

What is wrong with that? It stopped working suddenly.

AdamJachocki commented 5 months ago

SOLVED: Problems with bot configuration