Skip Navigation LinksHome Page > Forums > Integrations & Plug-Ins > IDE Integration > Authentication failed usi...
Hello,
I believe something was changed after the update of SpiraTest (v7.6.1.0)Currently I'm trying to figure out how to fix it. Previously the following code used to work:
import requests RUNNER_LINK = f"https://company.co.uk/SpiraTest/Services/v7_0/RestService.svc" api_key = '{B303FEC2-XXX-XXXX-XXXX-E1C9A891725F}' username = "SmithJ" RUNNER_NAME = "John Smith" params = {'username': username, 'api-key':api_key} headers = {'accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent':RUNNER_NAME} uri = "users" get_users = requests.get(f'{RUNNER_LINK}/{uri}', params=params, headers=headers) print(get_users)
I get response:
<Response [400]>
Which means: The HTTP 400 Bad Request client error response status code indicates that the server would not process the request due to something the server considered to be a client error. The reason for a 400 response is typically due to malformed request syntax, invalid request message framing, or deceptive request routing
Note 1. "api_key" copied form RSS / API Key. 2. Enable RSS Feeds: Yes
Do I need to add LDAP DN (CN=SmithJ,OU=Development,OU=companyUsers,DC=company,DC=co,DC=uk) into the params of to the header?
Potentially it could be caused by the company setting/permission.
Best Regards,N
Also when I've tried to use the link directly
https:/company.co.uk/SpiraTest/Services/v7_0/RestService.svc/projects?username=fredbloggs&api-key={B303FEC2-XXX-XXXX-XXXX-E1C9A891725F}
I received the following message:
The server encountered an error processing the request. The exception message is 'Access is denied.'. See server logs for more details. The exception stack trace is: at System.ServiceModel.Dispatcher.AuthorizationBehavior.Authorize(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
Please check the Event Log inside Spira for the first case, it will provide more information on what is causing the issue.
The second one looks like you are using a sample user 'fredbloggs' and so that makes sense that you are getting an authorization error.
Note that there were no breaking changes in our API in v7.6.1.0, in fact we deliberately version our APIs to avoid this.
If that doesn't help, please log a support ticket with us.
Regards
David
And if you have any questions, please email or call us at +1 (202) 558-6885