gpt4 book ai didi

authentication - 团队选项卡身份验证

转载 作者:行者123 更新时间:2023-12-04 06:46:28 24 4
gpt4 key购买 nike

我试图弄清楚如何使用 microsoftTeams.authentication.authenticate()功能,但我真的很困惑。当我调用该函数时,会在我的浏览器 (Chrome) 窗口中打开一个新选项卡,而不是在 Teams 本身中。这是正常行为吗?身份验证有效并重定向到我调用 microsoftTeams.authentication.notifySuccess() 的回调 url函数,但它不会返回 microsoftTeams.authentication.authenticate()成功回调(总是命中失败回调)。这是 validDomains 的问题吗? ?我很迷茫。任何帮助都会很棒!谢谢你。

microsoftTeams.authentication.authenticate({
url: "/auth",
width: 500,
height: 500,
successCallback: () => {
alert("auth success")
// Redirect to app
window.location.href = "/app"
},
failureCallback: () => {
alert("auth failure")
}
})

最佳答案

我想到了。

我打错了电话 microsoftTeams.authentication.authenticate()在页面加载时起作用,而不是在某些用户交互(如登录按钮单击)中起作用。

引用:"Add UI to your configuration or content page to enable the user to sign in when necessary. You should not drive the authentication pop-up without user action, because this is likely to trigger the browser's pop-up blocker."

关于authentication - 团队选项卡身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47599144/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com