Skip to content

Dotnet A365 Agent fails - no such type MsalUserAuthorization #167

Description

@graemefoster

Describe the bug
The dotnet Microsoft Agent framework agent fails to run. It starts, but quickly fails as there is no such type as 'MsalUserAuthorization' (in the a365 Agent Playground)

To Reproduce
Steps to reproduce the behavior:
Run the dotnet agent in the A365 playground. Observe above error.

Screenshots

ErrorCode: -50010
      Source: Microsoft.Agents.Builder
      Method: GetHandlerInstance
      TimeStamp: 2026-01-21T07:01:18.6312840Z
      Error: Handler name 'me' not found in configuration under AgentApplication:UserAuthorization:Handlers, or AgentApplication:UserAuthorization:DefaultHandlerName is invalid.
      HelpLink Url: https://aka.ms/M365AgentsErrorCodes/#-50010
      Stack Trace: at Microsoft.Agents.Builder.UserAuth.UserAuthorizationDispatcher.GetHandlerInstance(String handlerName)

Environment (please complete the following information):

  • OS: macos Tahoe
  • SDK Version: updated all libraries to latest version (problem exists on github repo as-is)

Activity

  1. rahuldevikar761 commented on Feb 3, 2026

    @rahuldevikar761
    Collaborator

    Hi Graeme (@graemefoster) Thanks for reporting this. There has been newer changes to the Agent sample and would appreciate if you can pull the latest and try out.

  2. graemefoster commented on Feb 17, 2026

    @graemefoster
    Author

    Rahul Devikar (@rahuldevikar761) have pulled the latest. Sample runs, but when I follow instructions to switch to OBO auth (running locally in playground), it breaks with the same error:

    System.InvalidOperationException: Type 'MsalUserAuthorization' not found in Assembly 'Microsoft.Agents.Builder' or is the wrong type for 'me'.
    
  3. graemefoster commented on Feb 21, 2026

    @graemefoster
    Author

    Rahul Devikar (@rahuldevikar761) definitely getting further.

    I can see agent lifecycle notification events come to me agent. But when I address the agent directly in teams my agent is not called.

    I tried to add some deliberate calls out to teams and spotted invalid_grant errors in the calls to get tokens.

    Fwiw everything works fine in the agent playground. I get the errors when running the agent behind a dev tunnel against my real o365 environment.

  4. lsl-2020 commented on Apr 1, 2026

    @lsl-2020

    @rahuldevikar761 have pulled the latest. Sample runs, but when I follow instructions to switch to OBO auth (running locally in playground), it breaks with the same error:

    System.InvalidOperationException: Type 'MsalUserAuthorization' not found in Assembly 'Microsoft.Agents.Builder' or is the wrong type for 'me'.
    

    Same here. My current guess is that the type 'MsalUserAuthorization' never exist and is purely fictional.

    For the first thing, I have searched in the entire Agents-for-net repo (the source for Microsoft.Agents.Builder and Microsoft.Agents.Authentication.Msal) for MsalUserAuthorization returned no files found.

    Secondly, UserAuthorizationModuleLoader.cs only hardcodes 3 types and MsalUserAuthorization is not one of them. The source at Agents-for-net/.../UserAuth/UserAuthorizationModuleLoader.cs (lines 50–61) has explicit else if branches for exactly:

    • AzureBotUserAuthorization
    • AgenticUserAuthorization
    • ConnectorUserAuthorization

    Could you please reopen this issue so that someone could take a look? Graeme (@graemefoster) Rahul Devikar (@rahuldevikar761)

    Also, including the author of the original PR (#132) here for consulting, abdulanu0 . Thanks.

  5. lsl-2020 commented on Apr 14, 2026

    @lsl-2020

    Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions