As described in this microsoft offcial doc, I have added share to teams button on my html page, but in pop-up that gets opened it gives error as
So how to authenticate the user, do we have to call another API for this or anything....
When I searched I found out about Graph API, but don't know is this what I need or how to use it.
I have created this simple html page.
HTML Code
<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>
When I opened share to teams button html file in incognito window I am able to repro your issue.
I have raised a bug for this issue and concerned team is working on it.
Alternatively you can use below code and Please go through this.
<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>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.