> On Jun 2, 2015, at 2:36 AM, Rajeev Kumar <
gane...@gmail.com> wrote:
>
> Hi,
>
> I am trying to write a client program to call a restfull GET with Basic authorization but it is giving 401 error (unauthorized client).
>
> below is piece of code i am using:
>
> var http = require('http');
> var options = {
> host: 'taken.generate.url',
> port: 38080,
> path: 'oauth2-api/p/v1/token?scope=TMO_ID_profile%20associated_lines%20token_validation%20iam_account_lock_information%20billing_information%20permission%20offer&grant_type=client_credentials',
> authorization: 'Basic VHJ1c3RlZENsaWVudENSMjQ6enJCamZ6cWdESw==',
> method: 'GET'
> };
authorization is not an option to the http library, but a header you send. Try
Also, please note that those credentials should have been throw-away ones. Decoded they are TrustedClientCR24:zrBjfzqgDK. You'll need to replace those credentials since they're compromised.