locked
Unable to generate Access Token & Refresh Token RRS feed

  • Question

  • 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"
    }

    Friday, February 5, 2016 10:49 AM

All replies

  • Hi Hitesh,

    it seems you are trying to do too much.

    The process is simpler:

    1) Obtain an access token from Azure ACS: The process is here: https://msdn.microsoft.com/en-us/library/hh454950.aspx. It takes only your client ID and secret.

    2) Use the access token in the appid parameter of the call to the translator API. For example in REST method calls: here: https://msdn.microsoft.com/en-us/library/ff512421.aspx

    Hope this helps,
    Chris Wendt
    Microsoft Translator

    Sunday, February 7, 2016 12:36 AM