Skip to content

[Bug]: Button Sign In From graph template is not rendered correctly #308

@raffifu

Description

@raffifu

Bug Description

OS: NixOS

I have encountered an issue when trying to use devtools in graph template. It didn't render correctly and cause i can't sign in. Here's my project setup

# pyproject.yaml
[project]
name = "your_app_name"
version = "0.1.0"
description = "A Microsoft Teams bot with Azure Graph integration"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
    "microsoft-teams-apps",
    "microsoft-teams-graph",
    "microsoft-teams-devtools",
    "dotenv"
]

[dependency-groups]
dev = [
    "pyright>=1.1.406",
]

[project.scripts]
start = "src.main:main"
typecheck = "pyright.cli:entrypoint"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["src"]
# received activity
{
    "id": "8f92fca7-9a7e-4af4-c743-4a330a3ec9ea",
    "type": "activity.sent",
    "body": {
        "id": "9ad6a909-7fa1-46aa-b0a1-78ab63bb0580",
        "activityParams": {
            "from": {
                "id": "",
                "role": "user",
                "name": ""
            },
            "conversation": {
                "id": "devtools",
                "conversationType": "personal",
                "name": "default",
                "isGroup": false
            },
            "type": "message",
            "recipient": {
                "id": "devtools",
                "role": "bot",
                "name": "devtools"
            },
            "inputHint": "acceptingInput",
            "attachments": [
                {
                    "contentType": "application/vnd.microsoft.card.oauth",
                    "content": {
                        "text": "Please Sign In...",
                        "connectionName": "something",
                        "tokenExchangeResource": null,
                        "tokenPostResource": {
                            "sasUrl": "https://token.botframework.com/api/sas/postToken?expiry="
                        },
                        "buttons": [
                            {
                                "type": "signin",
                                "title": "Sign In",
                                "image": null,
                                "text": null,
                                "displayText": null,
                                "value": "https://token.botframework.com/api/oauth/signin?signin=",
                                "channelData": null,
                                "imageAltText": null
                            }
                        ]
                    }
                }
            ]
        },
        "from": {
            "id": "",
            "aadObjectId": null,
            "role": "user",
            "properties": null,
            "name": ""
        },
        "conversation": {
            "id": "devtools",
            "tenantId": null,
            "conversationType": "personal",
            "name": "default",
            "isGroup": false
        },
        "type": "message",
        "recipient": {
            "id": "devtools",
            "aadObjectId": null,
            "role": "bot",
            "properties": null,
            "name": "devtools"
        },
        "inputHint": "acceptingInput",
        "attachments": [
            {
                "id": null,
                "contentType": "application/vnd.microsoft.card.oauth",
                "contentUrl": null,
                "content": {
                    "text": "Please Sign In...",
                    "connectionName": "something",
                    "tokenExchangeResource": null,
                    "tokenPostResource": {
                        "sasUrl": "https://token.botframework.com/api/sas/postToken?expiry="
                    },
                    "buttons": [
                        {
                            "type": "signin",
                            "title": "Sign In",
                            "image": null,
                            "text": null,
                            "displayText": null,
                            "value": "https://token.botframework.com/api/oauth/signin?signin=",
                            "channelData": null,
                            "imageAltText": null
                        }
                    ]
                },
                "name": null,
                "thumbnailUrl": null
            }
        ]
    },
    "sentAt": "2026-03-10T08:22:56.557678",
    "chat": {
        "id": "devtools",
        "conversationType": "personal",
        "name": "default",
        "isGroup": false
    }
}

Steps to Reproduce

  1. Initialize the project
npx @microsoft/teams.cli@latest new python your_app_name --template graph
  1. Add microsoft-teams-devtools as dependencies in pyproject.yaml
  2. Run uv venv && uv sync && uv run src/main.py
  3. open devtools in browser http://localhost:3979/devtools
  4. Type start and enter

Expected Behavior

It should rendered correctly, like this

Image

Note: I'm taking this screenshot from teams

Actual Behavior

Sign in button not generated correctly
Image

SDK Version

2.0.0a17

Python Version

3.12.12

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions