Hi Guys,
I have created client id, Client secret, and then generated Authorization code. At last, Using POST request have sent body containing certain parameters like
grant_type=authorization_code
&client_id=d1axxxx-xxxx-xxxx-xxxx-cf5796d90dd6%40d2076ad6-xxxx-xxxx-xxxx-24716a55ea90
&client_secret=RoYzG%2FAmf%2BaRrfNsdfdgLFsdfsxvMSHrj51BK4dUDqdB3%2BO4%3D
&code=<paste the long auth.code from previous step here>
&redirect_uri=https%3A%2F%2Flocalhost%2F
&resource=00000003-0000-0ff1-ce00-000000000000%2Fyour_site_name.sharepoint.com%40d2076ad6-6179-41cb-b792-24716a55ea90
i have used all the URL in Encoded format as well...
one more thing i was unable to find "application/x-form-urlencoded" value against "Content-type" in header...
--------------------------------Response Received---------------------------------------
{
"error": "invalid_request",
"error_description": "ACS90004: The request is not properly formatted.\r\nTrace ID: 4974e062-f5df-43b5-b0c9-cd15ccfe107d\r\nCorrelation
ID: e1a73eff-a8a7-4e24-a830-042ac6bd3145\r\nTimestamp: 2016-02-04 16:07:31Z",
"error_codes": [
90004
],
"timestamp": "2016-02-04 16:07:31Z",
"trace_id": "4974e062-f5df-43b5-b0c9-cd15ccfe107d",
"correlation_id": "e1a73eff-a8a7-4e24-a830-042ac6bd3145"
}