Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Delete user with proget api
-
Hello,
I'm using the ProGet api endpoint DELETE /api/security/users/delete?user=«username» to delete a user. Although the request return a 200 OK response, the user is not removed and still appears in ProGet. -
My guess is there's some kind of typo with the username you're sending.
The name is not validated before attempting to delete, which means you can type in any string and a
200will be returned.If you don't send an arggument, you will get an error however.
I would also try using
pgutil security users deleteto see if that helps:
https://docs.inedo.com/docs/proget/api/security/users/deleteThanks,
Alana -
@atripp
Thanks for your quick answer.
I checked the name and it's correct, I was able to find it into the proget portal.
I also check the Diagnostics Center but not error appear.
Do I need to add simple or double quote around the name?
Does pgutil a better option the api? -
Maybe you're attempting to delete a principal that's not a user, such as a group or
Anonymousor something.In any case, the API uses the exact same code as the UI; I'll share it:
case "delete": EnsureMethod(context, "POST", "DELETE"); var userName = context.Request.QueryString["user"]; if (string.IsNullOrEmpty(userName)) throw new HttpException(400, "Expected user query argument."); DB.Users_DeleteUser(userName); break;Here is the UI code for the button click on the
/administration/security/users/delete-user?userName=asdfasdfpage:var btnDelete = new PostBackButtonLink( "Yes, Delete User", () => { DB.Users_DeleteUser(this.UserName); WebUserContext.ClearCache(); this.CloseModalWindow(false); } );Your request might not be reaching the endpoint; I would attempt to do
DELETE /api/security/users/delete?something=nothingto make sure you're getting a400error.Hope that helps.
Alana
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login