User logged out when creating from API

Hi,

We are trying to create a new user using DHIS (2.14 release) api/account API. The user is getting created successfully. But the creator user is getting logged out and the new user created is getting logged in. We want to the creator’s session to continue. Is there any way to do it?

Thanks!

Hi,

I am still wondering if there is any way to continue the user session of the creator when a new user is being created using API.

···

On Thu, Mar 27, 2014 at 4:07 PM, Mahendra Kariya mahendrk@thoughtworks.com wrote:

Hi,

We are trying to create a new user using DHIS (2.14 release) api/account API. The user is getting created successfully. But the creator user is getting logged out and the new user created is getting logged in. We want to the creator’s session to continue. Is there any way to do it?

Thanks!

Hi there,

the account resource is a bit different from the user resource. The main use-case for the account controller is the self-registration process where people create their own accounts and then automatically proceed to log in. What you see is in other words intentional behavior.

In 2.15 which is out in a week or two we will support creation of users through the user resource. We plan to add this totrunk in a few days. This will allow you to create new users without changing the current credentials.

best regards,

Lars

···

On Tue, Apr 1, 2014 at 1:37 PM, Kiran Prakash kprakash@thoughtworks.com wrote:

Hello Lars,

It would be nice to hear from you on this issue. A couple of our design choices are dependent on this. For Eg. We might have to fork dhis2 and write our own module for user creation if there’s no way to create a user using the account API without logging out the admin user.

A quick Skype call to discuss this would be really helpful. Let me know when I can reach out to you.

Thanks in advance,

Kiran.

On Sat, Mar 29, 2014 at 8:44 PM, Mahendra Kariya mahendrk@thoughtworks.com wrote:

Hi,

I am still wondering if there is any way to continue the user session of the creator when a new user is being created using API.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Thu, Mar 27, 2014 at 4:07 PM, Mahendra Kariya mahendrk@thoughtworks.com wrote:

Hi,

We are trying to create a new user using DHIS (2.14 release) api/account API. The user is getting created successfully. But the creator user is getting logged out and the new user created is getting logged in. We want to the creator’s session to continue. Is there any way to do it?

Thanks!

Ok. Thanks a lot.

We’re facing the same issue with UserSetting object as well. Is there a way for admin user to UserSetting for another user using API without admin being logged out?

Regards,

Kiran.

···

On Tue, Apr 1, 2014 at 5:20 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi there,

the account resource is a bit different from the user resource. The main use-case for the account controller is the self-registration process where people create their own accounts and then automatically proceed to log in. What you see is in other words intentional behavior.

In 2.15 which is out in a week or two we will support creation of users through the user resource. We plan to add this totrunk in a few days. This will allow you to create new users without changing the current credentials.

best regards,

Lars

On Tue, Apr 1, 2014 at 1:37 PM, Kiran Prakash kprakash@thoughtworks.com wrote:

Hello Lars,

It would be nice to hear from you on this issue. A couple of our design choices are dependent on this. For Eg. We might have to fork dhis2 and write our own module for user creation if there’s no way to create a user using the account API without logging out the admin user.

A quick Skype call to discuss this would be really helpful. Let me know when I can reach out to you.

Thanks in advance,

Kiran.

On Sat, Mar 29, 2014 at 8:44 PM, Mahendra Kariya mahendrk@thoughtworks.com wrote:

Hi,

I am still wondering if there is any way to continue the user session of the creator when a new user is being created using API.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Thu, Mar 27, 2014 at 4:07 PM, Mahendra Kariya mahendrk@thoughtworks.com wrote:

Hi,

We are trying to create a new user using DHIS (2.14 release) api/account API. The user is getting created successfully. But the creator user is getting logged out and the new user created is getting logged in. We want to the creator’s session to continue. Is there any way to do it?

Thanks!

Understand. It's not supported but is easy to add, we can fix it in in day
or two.

Let me know if you feel like writing a patch, classes to touch
are DefaultUserSettingService.java (dhis-service-core)
and UserSettingController.java (dhis-web-api).

Lars

···

On Tue, Apr 1, 2014 at 2:09 PM, Kiran Prakash <kprakash@thoughtworks.com>wrote:

Ok. Thanks a lot.

We're facing the same issue with UserSetting object as well. Is there a
way for admin user to UserSetting for another user using API without admin
being logged out?

Yes. We can do that.

Thanks Lars!

···

On Tue, Apr 1, 2014 at 5:50 PM, Lars Helge Øverland larshelge@gmail.com wrote:

On Tue, Apr 1, 2014 at 2:09 PM, Kiran Prakash kprakash@thoughtworks.com wrote:

Ok. Thanks a lot.

We’re facing the same issue with UserSetting object as well. Is there a way for admin user to UserSetting for another user using API without admin being logged out?

Understand. It’s not supported but is easy to add, we can fix it in in day or two.

Let me know if you feel like writing a patch, classes to touch are DefaultUserSettingService.java (dhis-service-core) and UserSettingController.java (dhis-web-api).

Lars

Cool.

···

On Tue, Apr 1, 2014 at 2:29 PM, Kiran Prakash kprakash@thoughtworks.com wrote:

Yes. We can do that.

Thanks Lars!

On Tue, Apr 1, 2014 at 5:50 PM, Lars Helge Øverland larshelge@gmail.com wrote:

On Tue, Apr 1, 2014 at 2:09 PM, Kiran Prakash kprakash@thoughtworks.com wrote:

Ok. Thanks a lot.

We’re facing the same issue with UserSetting object as well. Is there a way for admin user to UserSetting for another user using API without admin being logged out?

Understand. It’s not supported but is easy to add, we can fix it in in day or two.

Let me know if you feel like writing a patch, classes to touch are DefaultUserSettingService.java (dhis-service-core) and UserSettingController.java (dhis-web-api).

Lars

Ok. Thanks, Is there a branch on Launchpad that has the User resource creation API that we can have a look at and start developing against?

···

On Tue, Apr 1, 2014 at 6:06 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Cool.

On Tue, Apr 1, 2014 at 2:29 PM, Kiran Prakash kprakash@thoughtworks.com wrote:

Yes. We can do that.

Thanks Lars!

On Tue, Apr 1, 2014 at 5:50 PM, Lars Helge Øverland larshelge@gmail.com wrote:

On Tue, Apr 1, 2014 at 2:09 PM, Kiran Prakash kprakash@thoughtworks.com wrote:

Ok. Thanks a lot.

We’re facing the same issue with UserSetting object as well. Is there a way for admin user to UserSetting for another user using API without admin being logged out?

Understand. It’s not supported but is easy to add, we can fix it in in day or two.

Let me know if you feel like writing a patch, classes to touch are DefaultUserSettingService.java (dhis-service-core) and UserSettingController.java (dhis-web-api).

Lars

Hi,

Support for creation/update of users is now available in 2.15. The format is the same as before (see output from /api/users), just that the password part will be encoded for every POST/PUT.

Please try it out, and report back any issues

···


Morten

On Tue, Apr 1, 2014 at 8:19 PM, Kiran Prakash kprakash@thoughtworks.com wrote:

Ok. Thanks, Is there a branch on Launchpad that has the User resource creation API that we can have a look at and start developing against?


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Tue, Apr 1, 2014 at 6:06 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Cool.

On Tue, Apr 1, 2014 at 2:29 PM, Kiran Prakash kprakash@thoughtworks.com wrote:

Yes. We can do that.

Thanks Lars!

On Tue, Apr 1, 2014 at 5:50 PM, Lars Helge Øverland larshelge@gmail.com wrote:

On Tue, Apr 1, 2014 at 2:09 PM, Kiran Prakash kprakash@thoughtworks.com wrote:

Ok. Thanks a lot.

We’re facing the same issue with UserSetting object as well. Is there a way for admin user to UserSetting for another user using API without admin being logged out?

Understand. It’s not supported but is easy to add, we can fix it in in day or two.

Let me know if you feel like writing a patch, classes to touch are DefaultUserSettingService.java (dhis-service-core) and UserSettingController.java (dhis-web-api).

Lars

Please be aware that is uses the same matching as our meta-data importer, which means that if you do a POST, and the code in userCredentials matches an already existing code, it will be treated as an update.

···


Morten

On Wed, Apr 2, 2014 at 6:01 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

Hi,

Support for creation/update of users is now available in 2.15. The format is the same as before (see output from /api/users), just that the password part will be encoded for every POST/PUT.

Please try it out, and report back any issues


Morten

On Tue, Apr 1, 2014 at 8:19 PM, Kiran Prakash kprakash@thoughtworks.com wrote:

Ok. Thanks, Is there a branch on Launchpad that has the User resource creation API that we can have a look at and start developing against?


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Tue, Apr 1, 2014 at 6:06 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Cool.

On Tue, Apr 1, 2014 at 2:29 PM, Kiran Prakash kprakash@thoughtworks.com wrote:

Yes. We can do that.

Thanks Lars!

On Tue, Apr 1, 2014 at 5:50 PM, Lars Helge Øverland larshelge@gmail.com wrote:

On Tue, Apr 1, 2014 at 2:09 PM, Kiran Prakash kprakash@thoughtworks.com wrote:

Ok. Thanks a lot.

We’re facing the same issue with UserSetting object as well. Is there a way for admin user to UserSetting for another user using API without admin being logged out?

Understand. It’s not supported but is easy to add, we can fix it in in day or two.

Let me know if you feel like writing a patch, classes to touch are DefaultUserSettingService.java (dhis-service-core) and UserSettingController.java (dhis-web-api).

Lars

On a general note we strongly recommend use of SSL/HTTPS when creating
users with passwords through the Web API outside local
testing/bootstrapping.

Hi,

Is 2.15 branch same as trunk or is it some other branch? If it is some other branch, could you please point us to the URL from where we can check out the code?

···

On Wed, Apr 2, 2014 at 4:38 PM, Lars Helge Øverland larshelge@gmail.com wrote:


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On a general note we strongly recommend use of SSL/HTTPS when creating users with passwords through the Web API outside local testing/bootstrapping.

It’s directly in trunk :slight_smile:

I just commitet a small fix, POSTs will be create only, and PUT will be update only

···

Morten

On Wed, Apr 2, 2014 at 6:34 PM, Mahendra Kariya mahendrk@thoughtworks.com wrote:

Hi,

Is 2.15 branch same as trunk or is it some other branch? If it is some other branch, could you please point us to the URL from where we can check out the code?

On Wed, Apr 2, 2014 at 4:38 PM, Lars Helge Øverland larshelge@gmail.com wrote:


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On a general note we strongly recommend use of SSL/HTTPS when creating users with passwords through the Web API outside local testing/bootstrapping.

I think there should be a functional with optional selector meta interface in between this

complex but complete work flow, for selection of user ( creator user or new user ) should

be logged in or logged out during new user creation process should be powered by super user.

Means work flow should support both, like if creator user willing to continue the session even

after new user creation. Or, if creator user recommend the next logged in should be performed for

just in time new user created by creator user. I think, this should not be automatically decided

by system’s artificial intelligence nomenclature, which user next should be logged in after new

user creation process, but by the mind set of creator user.

Regards

Brajesh Murari

P please consider the environment before printing this email

···

On Wednesday, 2 April 2014 4:34 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

Please be aware that is uses the same matching as our meta-data importer, which means that if you do a POST, and the code in userCredentials matches an already existing code, it will be treated as an update.


Morten

On Wed, Apr 2, 2014 at 6:01 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

Hi,

Support for creation/update of users is now available in 2.15. The format is the same as before (see output from /api/users), just that the password part will be encoded for every POST/PUT.

Please try it out, and report back any issues


Morten

On Tue, Apr 1, 2014 at 8:19 PM, Kiran Prakash kprakash@thoughtworks.com wrote:

Ok. Thanks, Is there a branch on Launchpad that has the User resource creation API that we can have a look at and start developing against?

On Tue, Apr 1, 2014 at 6:06 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Cool.

On Tue, Apr 1, 2014 at 2:29 PM, Kiran Prakash kprakash@thoughtworks.com wrote:

Yes. We can do that.

Thanks Lars!

On Tue, Apr 1, 2014 at 5:50 PM, Lars Helge Øverland larshelge@gmail.com wrote:

On Tue, Apr 1, 2014 at 2:09 PM, Kiran Prakash kprakash@thoughtworks.com wrote:

Ok. Thanks a lot.

We’re facing the same issue with UserSetting object as well. Is there a way for admin user to UserSetting for another user using API without admin being logged out?

Understand. It’s not supported but is easy to add, we can fix it in in day or two.

Let me know if you feel like writing a patch, classes to touch are DefaultUserSettingService.java (dhis-service-core) and UserSettingController.java (dhis-web-api).

Lars


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp