Resource parameter when requesting access token?
It looks like your providing the correct properties but not in the correct format. To get the token you need to issue a POST this data formatted for application/x-www-form-urlencoded
to https://login.microsoftonline.com/common/oauth2/v2.0/token
. From your example, it looks like your sending your data as JSON
rather than x-www-form-urlencoded
.
POST URL: https://login.microsoftonline.com/common/oauth2/v2.0/token
POST HEADER: Content-Type: application/x-www-form-urlencoded
POST BODY: grant_type=authorization_code&code=[AUTHORIZATION CODE]&
client_id=[APPLICATION ID]&client_secret=[PASSWORD]
&scope=[SCOPE]&redirect_uri=[REDIRECT URI]
I wrote up a Microsoft v2 Endpoint Primer a few months back that might help walk you through the procedure.