Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(token) => {
// After the access token is acquired, return to MS Teams, sending the acquired token
microsoftTeams.authentication.notifySuccess(token.accessToken);
},
(error) => {
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
});
}
});
}
private getAdminConsent() {
microsoftTeams.authentication.authenticate({
url: "/adminconsent.html?tenantId=" + this.tenantId,
width: 800,
height: 600,
successCallback: () => { },
failureCallback: (err) => { }
});
}
}
public processResponse(response: boolean, error: string) {
if (response) {
microsoftTeams.authentication.notifySuccess();
} else {
microsoftTeams.authentication.notifyFailure(error);
}
}
}