Is it possible to change the passwd of the users using the API??

Hi devs,

I didn’t see anything in the documentation in that regard. I could only find out the user replication as the only way to specify a user passwd using the API. Am I correct?

Thanks

Jose

Hi Jose,

Yes, it is possible to send the plain-text password of a user to the
system using the API, which will then hash the password for you and
persist it in the database.

Best regards,
Jason

···

On Mon, Feb 9, 2015 at 1:04 AM, Jose Garcia Muñoz <josemp10@gmail.com> wrote:

Hi devs,

I didn't see anything in the documentation in that regard. I could only find
out the user replication as the only way to specify a user passwd using the
API. Am I correct?

Thanks
Jose

_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

Thanks Jason,

sorry, and how should it work? I tried with the following call…

curl.exe -d @user.jsonhttp://localhost:8080/dhis/api/users/oEiOvqVp3A9” -H “Content-Type:application/json” -u myuser:mypasswd -v

where the user.json file just contains

{

“username”: “the_user_name”,

“password”: “the_user_passwd”

}

But the system gives me an error

Am I missing something?

Thanks

Jose

···

On Mon, Feb 9, 2015 at 6:13 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Jose,

Yes, it is possible to send the plain-text password of a user to the

system using the API, which will then hash the password for you and

persist it in the database.

Best regards,

Jason

On Mon, Feb 9, 2015 at 1:04 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Hi devs,

I didn’t see anything in the documentation in that regard. I could only find

out the user replication as the only way to specify a user passwd using the

API. Am I correct?

Thanks

Jose


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

Jason P. Pickering

email: jason.p.pickering@gmail.com

tel:+46764147049

You need to send the full payload. Are you on 2.18? you could use PATCH for this now… something like

{

“password”: “new-password”

}

curl -X PATCH -d @password.json -u user:pass http://localhost:8080/api/users/ID/password

(untested, but should work)

···

On Mon, Feb 9, 2015 at 6:43 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Jason,

sorry, and how should it work? I tried with the following call…

curl.exe -d @user.jsonhttp://localhost:8080/dhis/api/users/oEiOvqVp3A9” -H “Content-Type:application/json” -u myuser:mypasswd -v

where the user.json file just contains

{

“username”: “the_user_name”,

“password”: “the_user_passwd”

}

But the system gives me an error

Am I missing something?

Thanks

Jose


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


Morten

On Mon, Feb 9, 2015 at 6:13 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Jose,

Yes, it is possible to send the plain-text password of a user to the

system using the API, which will then hash the password for you and

persist it in the database.

Best regards,

Jason

On Mon, Feb 9, 2015 at 1:04 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Hi devs,

I didn’t see anything in the documentation in that regard. I could only find

out the user replication as the only way to specify a user passwd using the

API. Am I correct?

Thanks

Jose


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

Jason P. Pickering

email: jason.p.pickering@gmail.com

tel:+46764147049

Thanks Jason,

nope, I am using the 2.17. But will migrate to the 2.18 this afternoon. Will test it and let you know.

So in the 2.17 I would need to introduce all the information of the user again in the payload?

Thanks

Jose

···

On Mon, Feb 9, 2015 at 12:46 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

You need to send the full payload. Are you on 2.18? you could use PATCH for this now… something like

{

“password”: “new-password”

}

curl -X PATCH -d @password.json -u user:pass http://localhost:8080/api/users/ID/password

(untested, but should work)


Morten

On Mon, Feb 9, 2015 at 6:43 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Jason,

sorry, and how should it work? I tried with the following call…

curl.exe -d @user.jsonhttp://localhost:8080/dhis/api/users/oEiOvqVp3A9” -H “Content-Type:application/json” -u myuser:mypasswd -v

where the user.json file just contains

{

“username”: “the_user_name”,

“password”: “the_user_passwd”

}

But the system gives me an error

Am I missing something?

Thanks

Jose


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 Mon, Feb 9, 2015 at 6:13 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Jose,

Yes, it is possible to send the plain-text password of a user to the

system using the API, which will then hash the password for you and

persist it in the database.

Best regards,

Jason

On Mon, Feb 9, 2015 at 1:04 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Hi devs,

I didn’t see anything in the documentation in that regard. I could only find

out the user replication as the only way to specify a user passwd using the

API. Am I correct?

Thanks

Jose


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

Jason P. Pickering

email: jason.p.pickering@gmail.com

tel:+46764147049

Easiest was would be to GET the current payload of the user,modify the password to what you want and the POST this payload back, if you are on 2.17.

Regards,

Jason

···

On Mon, Feb 9, 2015 at 12:46 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

You need to send the full payload. Are you on 2.18? you could use PATCH for this now… something like

{

“password”: “new-password”

}

curl -X PATCH -d @password.json -u user:pass http://localhost:8080/api/users/ID/password

(untested, but should work)


Morten

On Mon, Feb 9, 2015 at 6:43 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Jason,

sorry, and how should it work? I tried with the following call…

curl.exe -d @user.jsonhttp://localhost:8080/dhis/api/users/oEiOvqVp3A9” -H “Content-Type:application/json” -u myuser:mypasswd -v

where the user.json file just contains

{

“username”: “the_user_name”,

“password”: “the_user_passwd”

}

But the system gives me an error

Am I missing something?

Thanks

Jose


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 Mon, Feb 9, 2015 at 6:13 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Jose,

Yes, it is possible to send the plain-text password of a user to the

system using the API, which will then hash the password for you and

persist it in the database.

Best regards,

Jason

On Mon, Feb 9, 2015 at 1:04 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Hi devs,

I didn’t see anything in the documentation in that regard. I could only find

out the user replication as the only way to specify a user passwd using the

API. Am I correct?

Thanks

Jose


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

Jason P. Pickering

email: jason.p.pickering@gmail.com

tel:+46764147049

Thanks Jason, Morten,

Morten, I have tried with the 2.18. However, I am getting the following answer “Property password does not exist on org.hisp.dhis.user.User”

···

On Mon, Feb 9, 2015 at 12:58 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Easiest was would be to GET the current payload of the user,modify the password to what you want and the POST this payload back, if you are on 2.17.

Regards,

Jason

On Feb 9, 2015 12:56 PM, “Jose Garcia Muñoz” josemp10@gmail.com wrote:

Thanks Jason,

nope, I am using the 2.17. But will migrate to the 2.18 this afternoon. Will test it and let you know.

So in the 2.17 I would need to introduce all the information of the user again in the payload?

Thanks

Jose

On Mon, Feb 9, 2015 at 12:46 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

You need to send the full payload. Are you on 2.18? you could use PATCH for this now… something like

{

“password”: “new-password”

}

curl -X PATCH -d @password.json -u user:pass http://localhost:8080/api/users/ID/password

(untested, but should work)


Morten

On Mon, Feb 9, 2015 at 6:43 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Jason,

sorry, and how should it work? I tried with the following call…

curl.exe -d @user.jsonhttp://localhost:8080/dhis/api/users/oEiOvqVp3A9” -H “Content-Type:application/json” -u myuser:mypasswd -v

where the user.json file just contains

{

“username”: “the_user_name”,

“password”: “the_user_passwd”

}

But the system gives me an error

Am I missing something?

Thanks

Jose


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 Mon, Feb 9, 2015 at 6:13 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Jose,

Yes, it is possible to send the plain-text password of a user to the

system using the API, which will then hash the password for you and

persist it in the database.

Best regards,

Jason

On Mon, Feb 9, 2015 at 1:04 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Hi devs,

I didn’t see anything in the documentation in that regard. I could only find

out the user replication as the only way to specify a user passwd using the

API. Am I correct?

Thanks

Jose


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

Jason P. Pickering

email: jason.p.pickering@gmail.com

tel:+46764147049

Hi, it should be on the userCredentials object.

···

On Mon, Feb 9, 2015 at 7:17 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Jason, Morten,

Morten, I have tried with the 2.18. However, I am getting the following answer “Property password does not exist on org.hisp.dhis.user.User”


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 Mon, Feb 9, 2015 at 12:58 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Easiest was would be to GET the current payload of the user,modify the password to what you want and the POST this payload back, if you are on 2.17.

Regards,

Jason

On Feb 9, 2015 12:56 PM, “Jose Garcia Muñoz” josemp10@gmail.com wrote:

Thanks Jason,

nope, I am using the 2.17. But will migrate to the 2.18 this afternoon. Will test it and let you know.

So in the 2.17 I would need to introduce all the information of the user again in the payload?

Thanks

Jose

On Mon, Feb 9, 2015 at 12:46 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

You need to send the full payload. Are you on 2.18? you could use PATCH for this now… something like

{

“password”: “new-password”

}

curl -X PATCH -d @password.json -u user:pass http://localhost:8080/api/users/ID/password

(untested, but should work)


Morten

On Mon, Feb 9, 2015 at 6:43 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Jason,

sorry, and how should it work? I tried with the following call…

curl.exe -d @user.jsonhttp://localhost:8080/dhis/api/users/oEiOvqVp3A9” -H “Content-Type:application/json” -u myuser:mypasswd -v

where the user.json file just contains

{

“username”: “the_user_name”,

“password”: “the_user_passwd”

}

But the system gives me an error

Am I missing something?

Thanks

Jose


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 Mon, Feb 9, 2015 at 6:13 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Jose,

Yes, it is possible to send the plain-text password of a user to the

system using the API, which will then hash the password for you and

persist it in the database.

Best regards,

Jason

On Mon, Feb 9, 2015 at 1:04 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Hi devs,

I didn’t see anything in the documentation in that regard. I could only find

out the user replication as the only way to specify a user passwd using the

API. Am I correct?

Thanks

Jose


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

Jason P. Pickering

email: jason.p.pickering@gmail.com

tel:+46764147049

Yes, sorry. You will need to patch the full userCredentials part of the user (its at least a bit smaller than the whole user payload)

···

On Tue, Feb 10, 2015 at 1:54 AM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi, it should be on the userCredentials object.


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


Morten

On Mon, Feb 9, 2015 at 7:17 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Jason, Morten,

Morten, I have tried with the 2.18. However, I am getting the following answer “Property password does not exist on org.hisp.dhis.user.User”


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 Mon, Feb 9, 2015 at 12:58 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Easiest was would be to GET the current payload of the user,modify the password to what you want and the POST this payload back, if you are on 2.17.

Regards,

Jason

On Feb 9, 2015 12:56 PM, “Jose Garcia Muñoz” josemp10@gmail.com wrote:

Thanks Jason,

nope, I am using the 2.17. But will migrate to the 2.18 this afternoon. Will test it and let you know.

So in the 2.17 I would need to introduce all the information of the user again in the payload?

Thanks

Jose

On Mon, Feb 9, 2015 at 12:46 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

You need to send the full payload. Are you on 2.18? you could use PATCH for this now… something like

{

“password”: “new-password”

}

curl -X PATCH -d @password.json -u user:pass http://localhost:8080/api/users/ID/password

(untested, but should work)


Morten

On Mon, Feb 9, 2015 at 6:43 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Jason,

sorry, and how should it work? I tried with the following call…

curl.exe -d @user.jsonhttp://localhost:8080/dhis/api/users/oEiOvqVp3A9” -H “Content-Type:application/json” -u myuser:mypasswd -v

where the user.json file just contains

{

“username”: “the_user_name”,

“password”: “the_user_passwd”

}

But the system gives me an error

Am I missing something?

Thanks

Jose


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 Mon, Feb 9, 2015 at 6:13 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Jose,

Yes, it is possible to send the plain-text password of a user to the

system using the API, which will then hash the password for you and

persist it in the database.

Best regards,

Jason

On Mon, Feb 9, 2015 at 1:04 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Hi devs,

I didn’t see anything in the documentation in that regard. I could only find

out the user replication as the only way to specify a user passwd using the

API. Am I correct?

Thanks

Jose


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

Jason P. Pickering

email: jason.p.pickering@gmail.com

tel:+46764147049

Thanks for the clarification.

Unfortunately it is still not working (likely because I am doing something wrong). So the call to the API that I tried is:

…api/users/zNdlm77vil8/userCredentials

and the payload:

{

“password”: “the_new_passwd”,

“id”: “AMuabF1Lrct”, (the id of the user credentials)

“name”: “user_name”,

“code”: “user_code”

}

But the system gives me the error: “Unknown payload format”

Any ideas? I think it is better if you could send me the call to the API and the format of the payload.

Many thanks

Jose

···

On Tue, Feb 10, 2015 at 4:51 AM, Morten Olav Hansen mortenoh@gmail.com wrote:

Yes, sorry. You will need to patch the full userCredentials part of the user (its at least a bit smaller than the whole user payload)


Morten

On Tue, Feb 10, 2015 at 1:54 AM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi, it should be on the userCredentials object.


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 Mon, Feb 9, 2015 at 7:17 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Jason, Morten,

Morten, I have tried with the 2.18. However, I am getting the following answer “Property password does not exist on org.hisp.dhis.user.User”


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 Mon, Feb 9, 2015 at 12:58 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Easiest was would be to GET the current payload of the user,modify the password to what you want and the POST this payload back, if you are on 2.17.

Regards,

Jason

On Feb 9, 2015 12:56 PM, “Jose Garcia Muñoz” josemp10@gmail.com wrote:

Thanks Jason,

nope, I am using the 2.17. But will migrate to the 2.18 this afternoon. Will test it and let you know.

So in the 2.17 I would need to introduce all the information of the user again in the payload?

Thanks

Jose

On Mon, Feb 9, 2015 at 12:46 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

You need to send the full payload. Are you on 2.18? you could use PATCH for this now… something like

{

“password”: “new-password”

}

curl -X PATCH -d @password.json -u user:pass http://localhost:8080/api/users/ID/password

(untested, but should work)


Morten

On Mon, Feb 9, 2015 at 6:43 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Jason,

sorry, and how should it work? I tried with the following call…

curl.exe -d @user.jsonhttp://localhost:8080/dhis/api/users/oEiOvqVp3A9” -H “Content-Type:application/json” -u myuser:mypasswd -v

where the user.json file just contains

{

“username”: “the_user_name”,

“password”: “the_user_passwd”

}

But the system gives me an error

Am I missing something?

Thanks

Jose


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 Mon, Feb 9, 2015 at 6:13 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Jose,

Yes, it is possible to send the plain-text password of a user to the

system using the API, which will then hash the password for you and

persist it in the database.

Best regards,

Jason

On Mon, Feb 9, 2015 at 1:04 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Hi devs,

I didn’t see anything in the documentation in that regard. I could only find

out the user replication as the only way to specify a user passwd using the

API. Am I correct?

Thanks

Jose


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

Jason P. Pickering

email: jason.p.pickering@gmail.com

tel:+46764147049

Hi

No, this will not work… as listed in the docs you need to also use the same property name in your JSON, so it should be:

{

“userCredentials”: { … same as before … }

}

···

On Wed, Feb 11, 2015 at 2:12 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks for the clarification.

Unfortunately it is still not working (likely because I am doing something wrong). So the call to the API that I tried is:

…api/users/zNdlm77vil8/userCredentials

and the payload:

{

“password”: “the_new_passwd”,

“id”: “AMuabF1Lrct”, (the id of the user credentials)

“name”: “user_name”,

“code”: “user_code”

}

But the system gives me the error: “Unknown payload format”

Any ideas? I think it is better if you could send me the call to the API and the format of the payload.

Many thanks

Jose


Morten

On Tue, Feb 10, 2015 at 4:51 AM, Morten Olav Hansen mortenoh@gmail.com wrote:

Yes, sorry. You will need to patch the full userCredentials part of the user (its at least a bit smaller than the whole user payload)


Morten

On Tue, Feb 10, 2015 at 1:54 AM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi, it should be on the userCredentials object.


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 Mon, Feb 9, 2015 at 7:17 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Jason, Morten,

Morten, I have tried with the 2.18. However, I am getting the following answer “Property password does not exist on org.hisp.dhis.user.User”


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 Mon, Feb 9, 2015 at 12:58 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Easiest was would be to GET the current payload of the user,modify the password to what you want and the POST this payload back, if you are on 2.17.

Regards,

Jason

On Feb 9, 2015 12:56 PM, “Jose Garcia Muñoz” josemp10@gmail.com wrote:

Thanks Jason,

nope, I am using the 2.17. But will migrate to the 2.18 this afternoon. Will test it and let you know.

So in the 2.17 I would need to introduce all the information of the user again in the payload?

Thanks

Jose

On Mon, Feb 9, 2015 at 12:46 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

You need to send the full payload. Are you on 2.18? you could use PATCH for this now… something like

{

“password”: “new-password”

}

curl -X PATCH -d @password.json -u user:pass http://localhost:8080/api/users/ID/password

(untested, but should work)


Morten

On Mon, Feb 9, 2015 at 6:43 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Jason,

sorry, and how should it work? I tried with the following call…

curl.exe -d @user.jsonhttp://localhost:8080/dhis/api/users/oEiOvqVp3A9” -H “Content-Type:application/json” -u myuser:mypasswd -v

where the user.json file just contains

{

“username”: “the_user_name”,

“password”: “the_user_passwd”

}

But the system gives me an error

Am I missing something?

Thanks

Jose


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 Mon, Feb 9, 2015 at 6:13 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Jose,

Yes, it is possible to send the plain-text password of a user to the

system using the API, which will then hash the password for you and

persist it in the database.

Best regards,

Jason

On Mon, Feb 9, 2015 at 1:04 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Hi devs,

I didn’t see anything in the documentation in that regard. I could only find

out the user replication as the only way to specify a user passwd using the

API. Am I correct?

Thanks

Jose


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

Jason P. Pickering

email: jason.p.pickering@gmail.com

tel:+46764147049

An example can be seen under "user account invitations" in web api docs:

https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s27.html#d5e3604

Thanks Lars, Morten,

Now the payload I am using is:

{

“userCredentials”:

{“password”: “new_passwd”,

“id”: “AMuabF1Lrct”,

“name”: “user_name”,

“code”: “user_code”,

“created”: “2014-11-27T18:24:05.888+0000”, (Do I need this?)

“lastUpdated”: “2015-02-11T11:57:58.116+0000”} (Do I need this?)

}

But still getting the same message: “Unknown payload format”.

···

On Wed, Feb 11, 2015 at 10:05 AM, Lars Helge Øverland larshelge@gmail.com wrote:

An example can be seen under “user account invitations” in web api docs:

https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s27.html#d5e3604

Can you give me the full cURL command you are using for this? including headers etc

···

On Wed, Feb 11, 2015 at 7:07 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Lars, Morten,

Now the payload I am using is:

{

“userCredentials”:

{“password”: “new_passwd”,

“id”: “AMuabF1Lrct”,

“name”: “user_name”,

“code”: “user_code”,

“created”: “2014-11-27T18:24:05.888+0000”, (Do I need this?)

“lastUpdated”: “2015-02-11T11:57:58.116+0000”} (Do I need this?)

}

But still getting the same message: “Unknown payload format”.


Morten

On Wed, Feb 11, 2015 at 10:05 AM, Lars Helge Øverland larshelge@gmail.com wrote:

An example can be seen under “user account invitations” in web api docs:

https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s27.html#d5e3604

sure,

curl.exe -X PATCH -d @c:\file.json -u myuser:mypasswd “http://localhost:8080/dhis/api/users/zNdlm77vil8/userCredentials

···

On Wed, Feb 11, 2015 at 2:01 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

Can you give me the full cURL command you are using for this? including headers etc


Morten

On Wed, Feb 11, 2015 at 7:07 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Lars, Morten,

Now the payload I am using is:

{

“userCredentials”:

{“password”: “new_passwd”,

“id”: “AMuabF1Lrct”,

“name”: “user_name”,

“code”: “user_code”,

“created”: “2014-11-27T18:24:05.888+0000”, (Do I need this?)

“lastUpdated”: “2015-02-11T11:57:58.116+0000”} (Do I need this?)

}

But still getting the same message: “Unknown payload format”.

On Wed, Feb 11, 2015 at 10:05 AM, Lars Helge Øverland larshelge@gmail.com wrote:

An example can be seen under “user account invitations” in web api docs:

https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s27.html#d5e3604

You need to include the content-type of what you are sending.

-H “Content-Type: application/json”

···

On Wed, Feb 11, 2015 at 8:08 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

sure,

curl.exe -X PATCH -d @c:\file.json -u myuser:mypasswd “http://localhost:8080/dhis/api/users/zNdlm77vil8/userCredentials


Morten

On Wed, Feb 11, 2015 at 2:01 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

Can you give me the full cURL command you are using for this? including headers etc


Morten

On Wed, Feb 11, 2015 at 7:07 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Lars, Morten,

Now the payload I am using is:

{

“userCredentials”:

{“password”: “new_passwd”,

“id”: “AMuabF1Lrct”,

“name”: “user_name”,

“code”: “user_code”,

“created”: “2014-11-27T18:24:05.888+0000”, (Do I need this?)

“lastUpdated”: “2015-02-11T11:57:58.116+0000”} (Do I need this?)

}

But still getting the same message: “Unknown payload format”.

On Wed, Feb 11, 2015 at 10:05 AM, Lars Helge Øverland larshelge@gmail.com wrote:

An example can be seen under “user account invitations” in web api docs:

https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s27.html#d5e3604

ups… :slight_smile: You are right, I completely forgot the Content-Type, sorry.

Almost there. The tomcat console gives me the following message:

  • INFO 2015-02-11 14:23:26,119 ‘devapp’ update org.hisp.dhis.user.User, name: xxxx, uid: zNdlm77vil8 (AuditLogUtil.java [http-apr-8080-exec-9])

So everything seems to be correct, but when I try to log in the system with that user, still has the old passwd…

Also, I am getting an error in the curl output. I am copying it here (maybe it is not very useful):

{color : black;}HR {color : #525D76;}–>

Estado HTTP 500 - Request processing failed; nested excepti

on is java.lang.NullPointerException


type Informe de Excepci├│n

mensaje

Request processing failed; nested exception is java.lang.NullPointerException

descripci├│n El ser

vidor encontr├│ un error interno que hizo que no pudiera rellenar este requerimiento.

excepci├│n

org.sp

ringframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:839)

javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118

)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:8

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.

java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwa

reRequestFilter.java:154)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java

:201)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticatio

nProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticatio

nProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(CustomAuthenticationFilter.java:64)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAccessFilter.java:115)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncMana

gerIntegrationFilter.java:50)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.j

ava:87)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)

org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)

org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:82)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

causa raíz

java.lang.NullPointerException

org.hisp.dhis.security.DefaultUsernameSaltSource.getSalt(DefaultUsernameSaltSource.java:49)

org.hisp.dhis.security.migration.SpringSecurityMigrationPasswordManager.legacyMatches(SpringSecurityMigrationPassword

Manager.java:76)

org.hisp.dhis.security.migration.SpringSecurityMigrationPasswordManager.legacyOrCurrentMatches(SpringSecurityMigratio

nPasswordManager.java:82)

org.hisp.dhis.user.DefaultUserService.encodeAndSetPassword(DefaultUserService.java:557)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:606)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.jav

···

On Wed, Feb 11, 2015 at 2:15 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

You need to include the content-type of what you are sending.

-H “Content-Type: application/json”


Morten

On Wed, Feb 11, 2015 at 8:08 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

sure,

curl.exe -X PATCH -d @c:\file.json -u myuser:mypasswd “http://localhost:8080/dhis/api/users/zNdlm77vil8/userCredentials

On Wed, Feb 11, 2015 at 2:01 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

Can you give me the full cURL command you are using for this? including headers etc


Morten

On Wed, Feb 11, 2015 at 7:07 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Lars, Morten,

Now the payload I am using is:

{

“userCredentials”:

{“password”: “new_passwd”,

“id”: “AMuabF1Lrct”,

“name”: “user_name”,

“code”: “user_code”,

“created”: “2014-11-27T18:24:05.888+0000”, (Do I need this?)

“lastUpdated”: “2015-02-11T11:57:58.116+0000”} (Do I need this?)

}

But still getting the same message: “Unknown payload format”.

On Wed, Feb 11, 2015 at 10:05 AM, Lars Helge Øverland larshelge@gmail.com wrote:

An example can be seen under “user account invitations” in web api docs:

https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s27.html#d5e3604

Hi Jose,

try specifying “username” instead of “name” property.

Lars

···

On Wed, Feb 11, 2015 at 2:32 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

ups… :slight_smile: You are right, I completely forgot the Content-Type, sorry.

Almost there. The tomcat console gives me the following message:

  • INFO 2015-02-11 14:23:26,119 ‘devapp’ update org.hisp.dhis.user.User, name: xxxx, uid: zNdlm77vil8 (AuditLogUtil.java [http-apr-8080-exec-9])

So everything seems to be correct, but when I try to log in the system with that user, still has the old passwd…

Also, I am getting an error in the curl output. I am copying it here (maybe it is not very useful):

{color : black;}HR {color : #525D76;}–>

Estado HTTP 500 - Request processing failed; nested excepti

on is java.lang.NullPointerException


type Informe de Excepci├│n

mensaje

Request processing failed; nested exception is java.lang.NullPointerException

descripci├│n El ser

vidor encontr├│ un error interno que hizo que no pudiera rellenar este requerimiento.

excepci├│n

org.sp

ringframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:839)

javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118

)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:8

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.

java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwa

reRequestFilter.java:154)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java

:201)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticatio

nProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticatio

nProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(CustomAuthenticationFilter.java:64)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAccessFilter.java:115)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncMana

gerIntegrationFilter.java:50)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.j

ava:87)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)

org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)

org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:82)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

causa raíz

java.lang.NullPointerException

org.hisp.dhis.security.DefaultUsernameSaltSource.getSalt(DefaultUsernameSaltSource.java:49)

org.hisp.dhis.security.migration.SpringSecurityMigrationPasswordManager.legacyMatches(SpringSecurityMigrationPassword

Manager.java:76)

org.hisp.dhis.security.migration.SpringSecurityMigrationPasswordManager.legacyOrCurrentMatches(SpringSecurityMigratio

nPasswordManager.java:82)

org.hisp.dhis.user.DefaultUserService.encodeAndSetPassword(DefaultUserService.java:557)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:606)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.jav

a:99)

org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport

.java:281)

org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

com.sun.proxy.$Proxy35.encodeAndSetPassword(Unknown Source)

org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.updateObject(DefaultIdentifiableObjectImporte

r.java:477)

org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.startImport(DefaultIdentifiableObjectImporter

.java:538)

org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObjectLocal(DefaultIdentifiableObjectIm

porter.java:517)

org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObject(DefaultIdentifiableObjectImporte

r.java:217)

org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObject(DefaultIdentifiableObjectImporte

r.java:103)

org.hisp.dhis.dxf2.metadata.DefaultImportService.doImport(DefaultImportService.java:278)

org.hisp.dhis.dxf2.metadata.DefaultImportService.importObject(DefaultImportService.java:112)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:606)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.jav

a:99)

org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport

.java:281)

org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

com.sun.proxy.$Proxy117.importObject(Unknown Source)

org.hisp.dhis.webapi.controller.AbstractCrudController.updateObjectProperty(AbstractCrudController.java:326)

org.hisp.dhis.webapi.controller.AbstractCrudController$$FastClassBySpringCGLIB$$92e3cd00.invoke(<generated>)

org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:649)

org.hisp.dhis.webapi.controller.user.UserController$$EnhancerBySpringCGLIB$$86713dbc.updateObjectProperty(<generat

ed>)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:606)

org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)

org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)

org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableH

andlerMethod.java:110)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingH

andlerAdapter.java:777)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandl

erAdapter.java:706)

org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:839)

javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118

)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:8

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.

java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwa

reRequestFilter.java:154)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java

:201)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticatio

nProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticatio

nProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(CustomAuthenticationFilter.java:64)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAccessFilter.java:115)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncMana

gerIntegrationFilter.java:50)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.j

ava:87)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)

org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)

org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:82)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

On Wed, Feb 11, 2015 at 2:15 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

You need to include the content-type of what you are sending.

-H “Content-Type: application/json”


Morten

On Wed, Feb 11, 2015 at 8:08 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

sure,

curl.exe -X PATCH -d @c:\file.json -u myuser:mypasswd “http://localhost:8080/dhis/api/users/zNdlm77vil8/userCredentials

On Wed, Feb 11, 2015 at 2:01 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

Can you give me the full cURL command you are using for this? including headers etc


Morten

On Wed, Feb 11, 2015 at 7:07 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Lars, Morten,

Now the payload I am using is:

{

“userCredentials”:

{“password”: “new_passwd”,

“id”: “AMuabF1Lrct”,

“name”: “user_name”,

“code”: “user_code”,

“created”: “2014-11-27T18:24:05.888+0000”, (Do I need this?)

“lastUpdated”: “2015-02-11T11:57:58.116+0000”} (Do I need this?)

}

But still getting the same message: “Unknown payload format”.

On Wed, Feb 11, 2015 at 10:05 AM, Lars Helge Øverland larshelge@gmail.com wrote:

An example can be seen under “user account invitations” in web api docs:

https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s27.html#d5e3604

Thanks Lars,

now I am getting the following output in the tomcat log

  • WARN 2015-02-11 15:53:49,477 Encoded password does not look like BCrypt (BCry

ptPasswordEncoder.java [http-apr-8080-exec-10])

and the same error in the curl output…

···

On Wed, Feb 11, 2015 at 2:33 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Jose,

try specifying “username” instead of “name” property.

Lars

On Wed, Feb 11, 2015 at 2:32 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

ups… :slight_smile: You are right, I completely forgot the Content-Type, sorry.

Almost there. The tomcat console gives me the following message:

  • INFO 2015-02-11 14:23:26,119 ‘devapp’ update org.hisp.dhis.user.User, name: xxxx, uid: zNdlm77vil8 (AuditLogUtil.java [http-apr-8080-exec-9])

So everything seems to be correct, but when I try to log in the system with that user, still has the old passwd…

Also, I am getting an error in the curl output. I am copying it here (maybe it is not very useful):

{color : black;}HR {color : #525D76;}–>

Estado HTTP 500 - Request processing failed; nested excepti

on is java.lang.NullPointerException


type Informe de Excepci├│n

mensaje

Request processing failed; nested exception is java.lang.NullPointerException

descripci├│n El ser

vidor encontr├│ un error interno que hizo que no pudiera rellenar este requerimiento.

excepci├│n

org.sp

ringframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:839)

javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118

)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:8

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.

java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwa

reRequestFilter.java:154)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java

:201)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticatio

nProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticatio

nProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(CustomAuthenticationFilter.java:64)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAccessFilter.java:115)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncMana

gerIntegrationFilter.java:50)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.j

ava:87)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)

org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)

org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:82)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

causa raíz

java.lang.NullPointerException

org.hisp.dhis.security.DefaultUsernameSaltSource.getSalt(DefaultUsernameSaltSource.java:49)

org.hisp.dhis.security.migration.SpringSecurityMigrationPasswordManager.legacyMatches(SpringSecurityMigrationPassword

Manager.java:76)

org.hisp.dhis.security.migration.SpringSecurityMigrationPasswordManager.legacyOrCurrentMatches(SpringSecurityMigratio

nPasswordManager.java:82)

org.hisp.dhis.user.DefaultUserService.encodeAndSetPassword(DefaultUserService.java:557)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:606)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.jav

a:99)

org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport

.java:281)

org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

com.sun.proxy.$Proxy35.encodeAndSetPassword(Unknown Source)

org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.updateObject(DefaultIdentifiableObjectImporte

r.java:477)

org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.startImport(DefaultIdentifiableObjectImporter

.java:538)

org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObjectLocal(DefaultIdentifiableObjectIm

porter.java:517)

org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObject(DefaultIdentifiableObjectImporte

r.java:217)

org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObject(DefaultIdentifiableObjectImporte

r.java:103)

org.hisp.dhis.dxf2.metadata.DefaultImportService.doImport(DefaultImportService.java:278)

org.hisp.dhis.dxf2.metadata.DefaultImportService.importObject(DefaultImportService.java:112)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:606)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.jav

a:99)

org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport

.java:281)

org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

com.sun.proxy.$Proxy117.importObject(Unknown Source)

org.hisp.dhis.webapi.controller.AbstractCrudController.updateObjectProperty(AbstractCrudController.java:326)

org.hisp.dhis.webapi.controller.AbstractCrudController$$FastClassBySpringCGLIB$$92e3cd00.invoke(<generated>)

org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:649)

org.hisp.dhis.webapi.controller.user.UserController$$EnhancerBySpringCGLIB$$86713dbc.updateObjectProperty(<generat

ed>)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

java.lang.reflect.Method.invoke(Method.java:606)

org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)

org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)

org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableH

andlerMethod.java:110)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingH

andlerAdapter.java:777)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandl

erAdapter.java:706)

org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:839)

javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118

)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:8

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.

java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwa

reRequestFilter.java:154)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java

:201)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticatio

nProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticatio

nProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(CustomAuthenticationFilter.java:64)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAccessFilter.java:115)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncMana

gerIntegrationFilter.java:50)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.j

ava:87)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)

org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)

org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:82)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

On Wed, Feb 11, 2015 at 2:15 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

You need to include the content-type of what you are sending.

-H “Content-Type: application/json”


Morten

On Wed, Feb 11, 2015 at 8:08 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

sure,

curl.exe -X PATCH -d @c:\file.json -u myuser:mypasswd “http://localhost:8080/dhis/api/users/zNdlm77vil8/userCredentials

On Wed, Feb 11, 2015 at 2:01 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

Can you give me the full cURL command you are using for this? including headers etc


Morten

On Wed, Feb 11, 2015 at 7:07 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Thanks Lars, Morten,

Now the payload I am using is:

{

“userCredentials”:

{“password”: “new_passwd”,

“id”: “AMuabF1Lrct”,

“name”: “user_name”,

“code”: “user_code”,

“created”: “2014-11-27T18:24:05.888+0000”, (Do I need this?)

“lastUpdated”: “2015-02-11T11:57:58.116+0000”} (Do I need this?)

}

But still getting the same message: “Unknown payload format”.

On Wed, Feb 11, 2015 at 10:05 AM, Lars Helge Øverland larshelge@gmail.com wrote:

An example can be seen under “user account invitations” in web api docs:

https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s27.html#d5e3604

That means that it worked, as the password you have sent is in clear text.

It is just a warning, but if you see this, then try and login as the
user with the new password and it should be fine.

···

On Wed, Feb 11, 2015 at 3:57 PM, Jose Garcia Muñoz <josemp10@gmail.com> wrote:

Thanks Lars,

now I am getting the following output in the tomcat log

* WARN 2015-02-11 15:53:49,477 Encoded password does not look like BCrypt
(BCry
ptPasswordEncoder.java [http-apr-8080-exec-10])

and the same error in the curl output...

On Wed, Feb 11, 2015 at 2:33 PM, Lars Helge Øverland <larshelge@gmail.com> > wrote:

Hi Jose,

try specifying "username" instead of "name" property.

Lars

On Wed, Feb 11, 2015 at 2:32 PM, Jose Garcia Muñoz <josemp10@gmail.com> >> wrote:

ups... :slight_smile: You are right, I completely forgot the Content-Type, sorry.

Almost there. The tomcat console gives me the following message:

* INFO 2015-02-11 14:23:26,119 'devapp' update org.hisp.dhis.user.User,
name: xxxx, uid: zNdlm77vil8 (AuditLogUtil.java [http-apr-8080-exec-9])

So everything seems to be correct, but when I try to log in the system
with that user, still has the old passwd...

Also, I am getting an error in the curl output. I am copying it here
(maybe it is not very useful):

{color : black;}HR {color : #525D76;}--></style> </head><body><h1>Estado
HTTP 500 - Request processing failed; nested excepti
on is java.lang.NullPointerException</h1><HR size="1"
noshade="noshade"><p><b>type</b> Informe de Excepci├│n</p><p><b>mensaje
</b> <u>Request processing failed; nested exception is
java.lang.NullPointerException</u></p><p><b>descripci├│n</b> <u>El ser
vidor encontr├│ un error interno que hizo que no pudiera rellenar este
requerimiento.</u></p><p><b>excepci├│n</b> <pre>org.sp
ringframework.web.util.NestedServletException: Request processing failed;
nested exception is java.lang.NullPointerException

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:839)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118
)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:8
4)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.
java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwa
reRequestFilter.java:154)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java
:201)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticatio
nProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticatio
nProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(CustomAuthenticationFilter.java:64)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAccessFilter.java:115)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncMana
gerIntegrationFilter.java:50)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.j
ava:87)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)

org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)

org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:82)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
</pre></p><p><b>causa raíz</b> <pre>java.lang.NullPointerException

org.hisp.dhis.security.DefaultUsernameSaltSource.getSalt(DefaultUsernameSaltSource.java:49)

org.hisp.dhis.security.migration.SpringSecurityMigrationPasswordManager.legacyMatches(SpringSecurityMigrationPassword
Manager.java:76)

org.hisp.dhis.security.migration.SpringSecurityMigrationPasswordManager.legacyOrCurrentMatches(SpringSecurityMigratio
nPasswordManager.java:82)

org.hisp.dhis.user.DefaultUserService.encodeAndSetPassword(DefaultUserService.java:557)
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        java.lang.reflect.Method.invoke(Method.java:606)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.jav
a:99)

org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport
.java:281)

org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
        com.sun.proxy.$Proxy35.encodeAndSetPassword(Unknown Source)

org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.updateObject(DefaultIdentifiableObjectImporte
r.java:477)

org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.startImport(DefaultIdentifiableObjectImporter
.java:538)

org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObjectLocal(DefaultIdentifiableObjectIm
porter.java:517)

org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObject(DefaultIdentifiableObjectImporte
r.java:217)

org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObject(DefaultIdentifiableObjectImporte
r.java:103)

org.hisp.dhis.dxf2.metadata.DefaultImportService.doImport(DefaultImportService.java:278)

org.hisp.dhis.dxf2.metadata.DefaultImportService.importObject(DefaultImportService.java:112)
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        java.lang.reflect.Method.invoke(Method.java:606)

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.jav
a:99)

org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport
.java:281)

org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
        com.sun.proxy.$Proxy117.importObject(Unknown Source)

org.hisp.dhis.webapi.controller.AbstractCrudController.updateObjectProperty(AbstractCrudController.java:326)

org.hisp.dhis.webapi.controller.AbstractCrudController$$FastClassBySpringCGLIB$$92e3cd00.invoke(&lt;generated&gt;)

org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:649)

org.hisp.dhis.webapi.controller.user.UserController$$EnhancerBySpringCGLIB$$86713dbc.updateObjectProperty(&lt;generat
ed&gt;)
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        java.lang.reflect.Method.invoke(Method.java:606)

org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)

org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)

org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableH
andlerMethod.java:110)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingH
andlerAdapter.java:777)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandl
erAdapter.java:706)

org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:839)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118
)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:8
4)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.
java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwa
reRequestFilter.java:154)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java
:201)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticatio
nProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticatio
nProcessingFilter.java:199)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(CustomAuthenticationFilter.java:64)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAccessFilter.java:115)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncMana
gerIntegrationFilter.java:50)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.j
ava:87)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)

org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)

org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:82)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

On Wed, Feb 11, 2015 at 2:15 PM, Morten Olav Hansen <mortenoh@gmail.com> >>> wrote:

You need to include the content-type of what you are sending.

-H "Content-Type: application/json"

--
Morten

On Wed, Feb 11, 2015 at 8:08 PM, Jose Garcia Muñoz <josemp10@gmail.com> >>>> wrote:

sure,

curl.exe -X PATCH -d @c:\file.json -u myuser:mypasswd
"http://localhost:8080/dhis/api/users/zNdlm77vil8/userCredentials"

On Wed, Feb 11, 2015 at 2:01 PM, Morten Olav Hansen >>>>> <mortenoh@gmail.com> wrote:

Can you give me the full cURL command you are using for this?
including headers etc

--
Morten

On Wed, Feb 11, 2015 at 7:07 PM, Jose Garcia Muñoz >>>>>> <josemp10@gmail.com> wrote:

Thanks Lars, Morten,

Now the payload I am using is:

{
"userCredentials":
{"password": "new_passwd",
  "id": "AMuabF1Lrct",
  "name": "user_name",
  "code": "user_code",
  "created": "2014-11-27T18:24:05.888+0000", (Do I need this?)
  "lastUpdated": "2015-02-11T11:57:58.116+0000"} (Do I need this?)
}

But still getting the same message: "Unknown payload format".

On Wed, Feb 11, 2015 at 10:05 AM, Lars Helge Øverland >>>>>>> <larshelge@gmail.com> wrote:

An example can be seen under "user account invitations" in web api
docs:

https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s27.html#d5e3604

_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049