I have Jenkins running on Windows, with Jenkins own database and security 
enabled, Roles based.

Each developer has an  application on their desktop where they can select a 
set of tests to run, all stored in TFS and SQL server, when they have 
chosen their required tests a C# COM aware dll is called to fire off the 
required job using a user and token and the REST API

All developers use the same user and token (It's hard-coded into the 
application).


I use this code below wrapped in a try catch.

    var authInfo = User.TrimEnd() + ":" + Token.TrimEnd();
     authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
     System.Net.WebClient webClient = new WebClient();
     webClient.Headers.Add("Authorization", "Basic " + authInfo);
     webClient.UploadString(URL, "");


The jobs fire and all is well.......then suddenly at some stage during the 
day or week the serve will return an error 403 Forbidden (C9). This the 
breaks for every other developer because we are using the same user name 
and token.

If I go into Jenkins and delete the user and re-add it with the exact same 
name, it picks up the original token....everyone can work again. I don't 
see anything in the Jenkins system log

Questions & Suggestions.

My C# is not great, if there is a better example of C# I'll happily give it 
a go.?

How can I trap the cause of this Jenkins user going into forbidden mode?

Is there another way to "release the lock" shall we say?

Regards

Neil

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/1684ac23-dfe5-4814-b5fe-3ddf8d9d3f3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to