Hi,
I am facing error for create user "Unauthorized 401" using fisheye.
My code is below for better understanding for trace my bug.
I am using c#.net for creating this fisheye user.
Error Like "
An exception of type 'System.Net.WebException' occurred in System.dll but was not handled in user code
Additional information: The remote server returned an error: (401) Unauthorized. "
string strCreateUserJson = "{ \"name\" : \"" + strUserName + "\",\"password\" : \"" + strPassword + "\",\"displayName\" : \"" + strDisplayName + "\",\"email\" :\"" + strEmailId + "\",\"type\" : \"built-in\",\"crucible\" : true}"; string strURI = "http://localhost:8060/rest-service-fecru/admin/users"; HttpWebRequest request = WebRequest.Create(strURI) as HttpWebRequest; request.ContentType = "application/json"; request.Method = "POST"; request.ContentLength = strJsonDatatoPass.Length; string base64Credentials = GetEncodedCredentials(); request.Headers.Add("Authorization", "Basic " + base64Credentials); using (StreamWriter writer = new StreamWriter(request.GetRequestStream())) { writer.Write(strJsonDatatoPass); } HttpWebResponse response = request.GetResponse() as HttpWebResponse; string result = string.Empty; using (StreamReader reader = new StreamReader(response.GetResponseStream())) { result = reader.ReadToEnd(); }
What can assigne for username and password for fisheye admin ?
I don't know or i ma entering wrong username and password for create user in fisheye.
private string GetEncodedCredentials() { string mergedCredentials = string.Format("{0}:{1}", strUserName, strPassword); byte[] byteCredentials = UTF8Encoding.UTF8.GetBytes(mergedCredentials); return Convert.ToBase64String(byteCredentials); }
Community moderators have prevented the ability to post new answers.
Now done it after set user set to admin role.
and it's username and password to GetEncodedCredentials() method it's strUserName, strPassword
Thanks,
Hi Mayank,
I think user logged in JIRA side either doesn't exist in FishEye side or is not among the groups allowed to read the repository.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rahul, Thanks for replay but actually this is not a problem i already set this groups allowed to read the repository. Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.