Reputation: 863
I'm trying to figure out how to use the microsoftTeams.authentication.authenticate()
function but I'm really confused. When I call the function, a new tab is opened in my browser (Chrome) window and not within Teams itself. Is this normal behavior? The authentication works and redirects to a callback url where I call the microsoftTeams.authentication.notifySuccess()
function but it doesn't get back to the microsoftTeams.authentication.authenticate()
success callback (always hits the failure callback). Is this an issue with validDomains
? I'm pretty lost. Any help would be great! Thank you.
microsoftTeams.authentication.authenticate({
url: "/auth",
width: 500,
height: 500,
successCallback: () => {
alert("auth success")
// Redirect to app
window.location.href = "/app"
},
failureCallback: () => {
alert("auth failure")
}
})
Upvotes: 4
Views: 4411
Reputation: 863
I figured it out.
I made the mistake of calling the microsoftTeams.authentication.authenticate()
function on page load instead of on some user interaction like a login button click.
Upvotes: 3