Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add more users #11

Closed
nicoesat opened this issue Jul 18, 2019 · 5 comments
Closed

How to add more users #11

nicoesat opened this issue Jul 18, 2019 · 5 comments
Labels

Comments

@nicoesat
Copy link

How do I create new users for Dicoogle?
There doesn't seem to be an UI to do so. I tried editing the users.xml file, but I don't know what type of hash is used to store the password.

According to the logs there should also be a roles.xml file. What should it look like? What can I do with it?

Nico

@Enet4 Enet4 added the question label Jul 18, 2019
@Enet4
Copy link
Collaborator

Enet4 commented Jul 18, 2019

Thank you for reporting. You are right that there is no UI for creating more users, but this is so because the current access control mechanisms included in the core Dicoogle project are very limited, and so this feature stands as a "second-class citizen", with little benefit other than making adjustments to user experience through other extensions.

There is a web service endpoint for creating and deleting existing users, in /user. Crafting the password hash by yourself is not recommended. For example, to add a new user:

curl -X PUT "http://localhost:8080/user?username=johndoe&password=secret"

One would replace the user name and password in the query string accordingly. To create a user with administrator powers:

curl -X PUT "http://localhost:8080/user?username=johndoe&password=secret&admin=true"

We may indeed consider adding this to the learning pack, for the time being in an "Advanced" section, considering the lack of UI.

@nicoesat
Copy link
Author

Wow, that was fast!

Thanks, that is exactly what I needed!

Nico

@nicoesat
Copy link
Author

But unfortunately the changes are not saved in the users.xml file so they don't survive a reboot.

@Enet4
Copy link
Collaborator

Enet4 commented Jul 18, 2019

Well, that is odd. The changes are expected to be saved immediately after issuing a new user, so this might be a bug. One that seems to have been fixed in the latest development versions (v3), but the changes made here are quite significant. This might indeed be related with issue bioinformatics-ua/dicoogle#361, since we've spotted similar routines for reading and writing XML configuration files.

Considering that we would like to make migrations to v3 as smooth as possible in the future, it might be worth fixing this bug in v2 as well.

@Enet4
Copy link
Collaborator

Enet4 commented Apr 27, 2021

Closing with #13

@Enet4 Enet4 closed this as completed Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants