Authetication token on DSS API - Java error

Hi Team,

A client is trying to retrieve authentication token using Java script as mentioned in the tutorial. But they do not get the token in the response. Can you please investigate?

{"date":"Tue
Aug 28 17:15:52 PDT
2018","headers":{"Cache-Control":["no-cache"],"Server":["Microsoft-IIS/7.5"],"X-App-Id":["Custom.RestApi"],"X-Request-Execution-Correlation-Id":["76223af6-8946-4e9d-ad12-59189599a7d7"],"Expires":["-1"],"Pragma":["no-cache"],"Content-Length":["403"],"X-App-Version":["12.1.509.64"],"Date":["Wed,
29 Aug 2018 00:15:52
GMT"],"Content-Type":["application/json;
charset=utf-8"]},"metadata":{"Cache-Control":["no-cache"],"Server":["Microsoft-IIS/7.5"],"X-App-Id":["Custom.RestApi"],"X-Request-Execution-Correlation-Id":["76223af6-8946-4e9d-ad12-59189599a7d7"],"Expires":["-1"],"Pragma":["no-cache"],"Content-Length":["403"],"X-App-Version":["12.1.509.64"],"Date":["Wed,
29 Aug 2018 00:15:52
GMT"],"Content-Type":["application/json;
charset=utf-8"]},"statusInfo":"OK","stringHeaders":{"Cache-Control":["no-cache"],"Server":["Microsoft-IIS/7.5"],"X-App-Id":["Custom.RestApi"],"X-Request-Execution-Correlation-Id":["76223af6-8946-4e9d-ad12-59189599a7d7"],"Expires":["-1"],"Pragma":["no-cache"],"Content-Length":["403"],"X-App-Version":["12.1.509.64"],"Date":["Wed,
29 Aug 2018 00:15:52
GMT"],"Content-Type":["application/json;
charset=utf-8"]},"length":403,"mediaType":"application/json;charset=utf-8","cookies":{},"closed":false,"links":[],"allowedMethods":[],"properties":{"com.ebayinc.platform.jaxrs.client.resilience.api.ServiceConfiguration":{"serviceGroup":"reuters"},"CALLTRANSACTION":{},"com.ebayinc.platform.jaxrs.client.resilience.core.ResilientServiceContext":{},"ClientId":"reuters"},"status":200}

Best Answer

  • steven.peng
    Answer ✓

    @Meenakshi.Swarnkar,

    The message shown above is the header of the response message and at the end, it shows "status":200 which means the request was successful. The returned authentication token should be in the body part of the response message, not in the header.

    Please ask the custom try to run the simple Java Authentication test program as Christiaan suggested, or use Postman to test the token request message as shown in the Portal tutorials.

Answers

  • @Meenakshi.Swarnkar,

    we have Java code examples available in our downloads, they are described in this document. For token retrieval there are 3 samples:

    1. A simple one
    2. One that goes through a proxy
    3. One for use with a proxy that requires authentication.

    I suggest you ask your customer to try to run one of these (the one that fits his network access).

    If it works, then he has functional code he can use in his project.

    If it does not work, then he has a different issue which would require further investigation (in which case we'd need his code to investigate in depth).