![](/img/trans.png)
[英]Microsoft Graph API - how to get access token without Authorization Code?
[英]How to add the permissions in the access token of Microsoft Graph API
我想使用 Microsoft Graph API 來發送電子郵件。 因此,我遵循的步驟是:我想首先獲取訪問令牌以通過 Microsoft Send Mail API 發送郵件。 為了獲取訪問令牌,我一直在嘗試使用客戶端憑據流來獲取訪問令牌,並嘗試了 Postman 的以下 curl。
curl --location --request POST 'https://login.microsoftonline.com/85173d93-99ef-4dff-9b45-495719659133/oauth2/v2.0/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: fpc=AnGmtKaDzItFhP3TSH4j_oCmg-KtAwAAAKMJi9gOAAAAdjbDngIAAAB7DYvYDgAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd' \
--data-urlencode 'client_id=f0599628-cd3a-4478-84f0-563cb5a10f3b' \
--data-urlencode 'scope=api://f0599628-cd3a-4478-84f0-563cb5a10f3b/.default' \
--data-urlencode 'client_secret=e._hTCMiSgT2zr6h0U4_AEg-3.tDE71Nz~' \
--data-urlencode 'grant_type=client_credentials'
我正在從此端點獲取訪問令牌,但此訪問令牌中沒有權限。
因此,當我嘗試發送郵件時,出現以下錯誤。
請幫忙。 如果需要任何進一步的信息,請告訴我。
這些是我已經添加的用於發送電子郵件的權限,但仍然無法弄清楚是什么問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.