Getting error while requesting access token for EWS oauth2 v2.0 with client_credintials grant type.
https://login.microsoftonline.com/tenantid/oauth2/v2.0/token
• Request Headers:
• Content-Type:"application/x-www-form-urlencoded"
• Postman-Token:"27a57c92-a5aa-47b7-8121-01ceb18d1d50"
• User-Agent:"PostmanRuntime/7.6.0"
• Host:"login.microsoftonline.com"
• Request Body:
• client_id:"***********************"
• client_secret:"*********************"
• scope:"https://outlook.office365.com/EWS.AccessAsUser.All"
• grant_type:"client_credentials"
Response Body:
• error:"invalid_scope" • error_description:"AADSTS70011: The provided request must include a 'scope' input parameter. The provided value for the input parameter 'scope' is not valid. The scope https://outlook.office365.com/EWS.AccessAsUser.All is not valid. Trace ID: 9e6cbb7a-34ed-4797-b650-4c99becb3b00 Correlation ID: c2295999-9cc2-4ba3-a12b-a26f3fc10d08 Timestamp: 2019-01-25 06:17:43Z" • error_codes: • 0:70011 • timestamp:"2019-01-25 06:17:43Z" • trace_id:"9e6cbb7a-34ed-4797-b650-4c99becb3b00" correlation_id:"c2295999-9cc2-4ba3-a12b-a26f3fc10d08"
The scope
should be https://outlook.office365.com/.default
, then it will work fine. See this link.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With