Microsoft Teams - Tab App - Authentication (no popup in Desktop Client, but working in Teams Web)

Sébastien Leroux 1 Reputation point
2020-06-23T10:31:36.59+00:00

I have a microsoft teams app, built with the yeoman teams generator.

The app works fine in teams (web), but not in the desktop client.

The issue seems to be related to this call (+/- the same as the sample):

private async getAccessToken(promptConsent: boolean = false): Promise<string> {
        try{
            let queryParams = {
                client_id: "teams-app",
                response_type: "id_token token",
                response_mode: "fragment",
                redirect_uri: window.location.origin + "/auth-end.html",
                nonce: this.uuidv4()
            };
            return new Promise<string>((resolve, reject) => {
            microsoftTeams.authentication.authenticate({
                url: "https://[keycloakURL]/auth/realms/EV/protocol/openid-connect/auth?"+this.toQueryString(queryParams),
                width: 600,
                height: 535,
                successCallback: (accessToken: string) => {
                resolve(accessToken);
                },
                failureCallback: (reason) => {
                reject(reason);
                }
            });
            });
        }catch(e){
            console.log(e);
            return "";
        }
      }

I can get neither the failure reason, nor the access token... But in the web, the app works fines...

Any idea? Or any suggestion to debug (I've tried with the Microsoft Teams Client Debugger, but no luck...)

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,268 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sharon Zhao-MSFT 25,101 Reputation points Microsoft Vendor
    2020-06-24T02:11:49.397+00:00

    Hi SbastienLeroux-9987,

    Thanks for visiting our forum. Our forum focuses on Microsoft Teams, which is the hub for team collaboration in Office 365.

    Based on your description, this problem is related to Teams development, which we do not support. You can reach the experts in MSDN forum about this problem. Hope you get better response.

    Thanks for your understanding.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.