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://learn.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.