javascript - 如何使用 Microsoft Share To Teams 按钮对用户进行身份验证?
问题描述
如this microsoft offcial doc中所述,我在我的html页面上添加了共享到团队按钮,但是在打开的弹出窗口中它给出了错误
那么如何对用户进行身份验证,我们是否必须为此调用另一个 API 或其他任何东西......
当我搜索时,我发现了 Graph API,但不知道这是我需要的或如何使用它。
我创建了这个简单的 html 页面。
HTML 代码
<html>
<head>
<title>Hello Teams</title>
<script async defer src="https://teams.microsoft.com/share/launcher.js"></script>
</head>
<body>
<h1>Share to Teams</h1>
<p>Please click on this icon below</p>
<span
class="teams-share-button"
data-icon-px-size="64"
data-href="https://docs.microsoft.com/en-us/graph/teams-concept-overview"
data-preview="false"
data-msg-text="Hello Avengers"
data-assign-title="Demo Share"
data-assign-instr="Demo Default Assignment Instructions"></span>
</body>
</html>
解决方案
当我在隐身窗口中打开共享到团队按钮 html 文件时,我能够重现您的问题。
我已经针对这个问题提出了一个错误,相关团队正在努力解决这个问题。
或者,您可以使用下面的代码,请仔细阅读。
<div class="teams-share-button" data-href="https://docs.microsoft.com">
<a target="ms-teams-share-popup" onclick="window.open('https://teams.microsoft.com/share?href=https%3A%2F%2Fdocs.microsoft.com&referrer=docs.microsoft.com', 'ms-teams-share-popup', 'width=700,height=600'); return false" href="https://teams.microsoft.com/share?href=https%3A%2F%2Fdocs.microsoft.com&referrer=docs.microsoft.com">
<img alt="Share to Microsoft Teams" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0i...Zz4=" width="32" height="32">
</a>
</div>
推荐阅读
- android - 检测 EditText 的 Input 是 Number 并且不允许用户输入其他类型的字符
- python - 如何使用 Keras 检测帧中的多个对象
- angular - 错误:模块构建失败(来自 ./node_modules/mini-css-extract-plugin/dist/loader.js):
- testing - 如何使用 Capl 为不同的测试用例更改特定信号的值
- vue.js - 如何更改 pagekit cms 中的默认编辑器
- java - ConcurrentModificationException,如何避免?
- django - Django Admin 的日期格式
- .net - 如何使用 SQLPackage.exe 比较 dacpac 文件中的数据(非 SCHEMA)
- amazon-web-services - AWS Cloud 9 清除缓存和使用的内存
- c++ - LNK2019 及其简单英语的含义