Project

General

Profile

Change auhentication method for all users

Added by Jp Mill about 5 years ago

Hi , do you have any tips on how I can change the authentication method for all my users ? We changed to AD recently and want to use that for every user.


Replies (2)

RE: Change auhentication method for all users - Added by Mayama Takeshi about 5 years ago

I think you can use the Redmine API:
http://www.redmine.org/projects/redmine/wiki/Rest_Users

You can use this python module to simplify Redmine API access:
https://python-redmine.com/

I believe you just have to change the auth_source_id.
Get it from one user that has Authentication Mode set to AD and set it to another one.
You can test setting the auth_source_id with something like this:

  curl -u TOKEN 'http://REDMINE_SERVER/users/USER_ID.json -X PUT -H 'Content-Type: application/json' -d '{"user": {"auth_source_id": AUTH_SOURCE_ID}}'

If it works then you can write a script to iterate for every user and set all to that same auth_source_id.

RE: Change auhentication method for all users - Added by Jp Mill over 4 years ago

I just updated the atuh_id in the user table . Pretty easy

update users set auth_source_id = 2 where auth_source_id = 1;

    (1-2/2)