[英]Microsoft identity platform and OAuth 2.0 authorization code flow (PKCE) - Error "AADSTS700025"
[英]Microsoft Graph oauth2 error AADSTS900144: the request body must contain the following parameter "grant type"
不斷收到此錯誤,我有正確的重定向 URI、clientId、clientSecret、grant_type 和 scope。我嘗試在主體中作為表單數據作為 url 查詢參數,但我一直收到完全相同的錯誤。 我有正確的代碼,我嘗試刷新它但無濟於事。 基礎 url 是https://login.microsoftonline.com/common/oauth2/v2.0/token 。
res = wrapped_post(
MS_BASE,
headers={"Content-Type": "application/x-www-form-urlencoded"},
params = {
"redirect_uri": "http://localhost/",
"client_id": clientId,
"scope": "Files.ReadWrite offline_access",
},
payload={
"redirect_uri": "http://localhost/",
"client_id": clientId,
"scope": "Files.ReadWrite offline_access",
"grant_type": "authorization_code",
"code": code,
"client_secret": client_secret
},
)
這是一個示例請求。 我試過使用 files= 而不是有效負載(對於表單數據),沒有任何查詢參數,所有查詢參數等wrapped_post
只是一個 function 用於包裝請求。post function,具有相同的 kwargs(有效負載代替我相信身體)。
grant_type=code 需要在參數中
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.