How to use the @microsoft/teams-js.authentication function in @microsoft/teams-js

To help you get started, we’ve selected a few @microsoft/teams-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OfficeDev / TrainingContent / Teams / 04 Fundamentals of Microsoft Teams / Demos / 03-tab-graph / solution / src / app / scripts / auth.ts View on Github external
(token) => {
        // After the access token is acquired, return to MS Teams, sending the acquired token
        microsoftTeams.authentication.notifySuccess(token.accessToken);
      },
      (error) => {
github OfficeDev / TrainingContent / Teams / 04 Fundamentals of Microsoft Teams / Demos / 03-tab-graph / solution / src / app / scripts / teamsApp1Tab / TeamsApp1Tab.tsx View on Github external
private getGraphData() {
    this.setState({
      graphData: "Loading..."
    });

    microsoftTeams.authentication.authenticate({
      url: "/auth.html",
      width: 400,
      height: 400,
      successCallback: (data) => {
        // Note: token is only good for one hour
        this.token = data!;
        this.getData(this.token);
      },
      failureCallback: (err) => {
        this.setState({
          graphData: "Failed to authenticate and get token.<br>" + err
        });
      }
    });
  }
github OfficeDev / TrainingContent / Teams / 04 Fundamentals of Microsoft Teams / Demos / 03-tab-graph / solution / src / app / scripts / teamsApp1Tab / TeamsApp1TabConfig.tsx View on Github external
private getAdminConsent() {
    microsoftTeams.authentication.authenticate({
      url: "/adminconsent.html?tenantId=" + this.tenantId,
      width: 800,
      height: 600,
      successCallback: () => { },
      failureCallback: (err) => { }
    });
  }
}
github OfficeDev / TrainingContent / Teams / 04 Fundamentals of Microsoft Teams / Demos / 03-tab-graph / solution / src / app / scripts / adminconsent.ts View on Github external
public processResponse(response: boolean, error: string) {
    if (response) {
      microsoftTeams.authentication.notifySuccess();
    } else {
      microsoftTeams.authentication.notifyFailure(error);
    }
  }
}

@microsoft/teams-js

Microsoft Client SDK for building app for Microsoft hosts

MIT
Latest version published 24 days ago

Package Health Score

95 / 100
Full package analysis

Similar packages