Invalid AppId passed on token: <app_ID>

Supriya Saraogi 1 Reputation point

Hi Team, I'm trying to authenticate incoming request from bot connector service to bot.
I have implemented the following code to validate the request but I'm getting error:

public boolean validateRequest(String headerAuthenticationValue, String request) throws ExecutionException, InterruptedException {
Activity botPayload = gson.fromJson(request, Activity.class);
boolean isValid = validateAuthToken(headerAuthenticationValue, botPayload);
return isValid;

private static boolean validateAuthToken(String headerAuthenticationValue, Activity botPayload) throws ExecutionException, InterruptedException {
CredentialProvider credentialProvider = new SimpleCredentialProvider();
CompletableFuture<ClaimsIdentity> claimsIdentity = authenticateToken(headerAuthenticationValue,
return true;
return false;
} AppId passed on token: <app_ID> (App id received in header)  

P.S I have not published my bot yet. I create the bot through app studio.
Documents referred -

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
688 questions
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
8,085 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
2,521 questions
{count} votes

2 answers

Sort by: Most helpful
  1. YutongTie-MSFT 39,361 Reputation points

    Hello @Supriya Saraogi

    I hope you have solved your issue and I just want to double click on this issue to see if you need further help. I think Rohit and Chetan both pointed out "App_Id" may be the root cause, I hope you have chance to check on above workarounds.

    Please let us know if you need deeper help. Thanks.


    0 comments No comments

  2. Daniel Levy 1 Reputation point

    @romungi-MSFT , @YutongTie-MSFT
    Hi, I'm getting the same error, and I've tried using the API as you suggested from postman and got the expected result (status code 200 and a token)
    I've opened a github issue:

    please help with this since ms-teams and developer portal had and still have some other bugs that made us issues during some POC's and we would like to fix this ASAP.

    0 comments No comments