.Net Rally.RestApi error "Action not allowed: invalid key" while creating rally test folder
I have a C # application using version 2.0.1.0 of the Rally Rest API for .NET. The app will successfully request a Rally for data, but when I try to create an object, an error is returned with an invalid key. This problem started today and is happening to multiple users of the application. I am using the following line of code for authentication.
myRestApi = new RallyRestApi (Rally_username, Rally_password, Rally_URL, "v2.0", myProxy);
I read some online help indicating the need for a security token, however this post makes me feel like this is not needed: "Note: when using any of the Rally Tool Rails or the app's SDK, this will be handled automatically."
I tried upgrading to 3.0 (beta), but that doesn't solve the problem.
source to share
Messages are popping up stating that using ApiKey instead of Basic Authentication with username / password resolves an invalid key error.
Rally.NET toolkit supports ApiKey authentication .
Constructor for v2.0.1:
restApi = new RallyRestApi("_abc123","https://rally1.rallydev.com","v2.0");
Constructor for v3.0.1:
restApi.Authenticate("_abc123", "https://rally1.rallydev.com", allowSSO: false);
source to share
I was getting the same error and noticed that I didn't recognize my username and password, which I saved in the section <appSettings>
Web.config
. For some reason this won't allow them to be read, so I decided to save the credentials elsewhere, in Properties => Settings in my app, and it has been working ever since.
Here is a code snippet of what the initialization of the Rally API looks like to me:
RallyRestApi restApi = new RallyRestApi(webServiceVersion: "v2.0");
string user = Properties.Settings.Default.username;
string pass = Properties.Settings.Default.password;
string rallyURL = Properties.Settings.Default.rallyURL;
restApi.Authenticate(user, pass, rallyURL, proxy: null, allowSSO: false);
Hope it helps!
source to share