Suppose I have created an Azure AD application and provided the necessesory graph permissions(Application Permissions) to it.
I want to write a code to create a Team in Microsoft Teams from sharepoint page/custom action.
As Example:
POST https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token HTTP/1.1
Host: login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded
client_id=535fb089-9ff3-47b6-9bfb-4f1264799865
&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default
&client_secret=qWgdYAmab0YSkuL1qKv5bPX
&grant_type=client_credentials
I want to hit the above api to retrive the access token from the AzureAD Application to use the MS-Graphs api in my Sharepoint page using javascript or spfx.strong text