0
votes

I developed a chrome extension using Rally's WSAPI v2.0, and it basically does the following things:

  1. get user and project, and store them
  2. get current iteration everytime
  3. send a post request to create a workitem

For the THIRD step, I sometimes get error ["Not authorized to perform action: Invalid key"] since end of last month.

[updated]Error can be reproduced everytime if I log in Rally website via SSO before using the extension to send requests via apikey. What's the best practice to send subsequent requests via apikey in my extension since I can't control end users' habits?

I did see some similar posts but none of them is helpful... and in case it helps:

function initXHR(method, url, apikey, cbFunc) {
  let httpRequest = new XMLHttpRequest();
  ...
  httpRequest.open(method, url);
  httpRequest.setRequestHeader('Content-Type', ' application\/json');
  httpRequest.setRequestHeader('Accept', ' application\/json');
  httpRequest.setRequestHeader('ZSESSIONID', apikey);
  httpRequest.onreadystatechange = function() {
    ...
    };
  return httpRequest;
}
...
usReq = initXHR ('POST', baseURL+'hierarchicalrequirement/create', apikey, function(){...});

Anyone has any idea / suggestion? Thanks a million!

1

1 Answers

1
votes

I've seen this error when the API key had both read-only and full-access grants configured. I would start by making sure your key only has the full-access grant.