Fórum

How to get User Name and Password in JSON webservice Call?

thumbnail
L P Bharat, modificado 10 Anos atrás.

How to get User Name and Password in JSON webservice Call?

Junior Member Postagens: 39 Data de Entrada: 20/08/08 Postagens Recentes
Hi All,

I have to implement JSON web service in liferay. This web service will interact with some external application on server.
My requirement is to pass username and password of the currently logged in user to these external applications.
Unfortunately I don't fin a way to get user name and password of the currently logged in user in my json webservice.


I know in my service Implementation class I can get user by "this.getUser()" method but I don't know how to get user unencrypted password in that.

Please suggest me how to achieve this.

Regards,
Lok
thumbnail
David H Nebinger, modificado 10 Anos atrás.

RE: How to get User Name and Password in JSON webservice Call?

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
You cannot, it is not stored. It's a security vulnerability.

So the password is not stored, it's a hash of the password; it is only one way. When you put a password in, it is hashed and a value comes out. That value is compared with what is stored in the DB and if the hash matches, you're good. But you cannot go from the hash back to the password (a hash value can be a collision of how multiple actual passwords may end up being the same value depending upon the hash algorithm).
thumbnail
L P Bharat, modificado 10 Anos atrás.

RE: How to get User Name and Password in JSON webservice Call?

Junior Member Postagens: 39 Data de Entrada: 20/08/08 Postagens Recentes
Thanks David.
Can you suggest me a way to achieve this functionality.
I need to pass username and password to external systems from liferay. Username / password in liferay and external systems are same.

Thanks
Lok
thumbnail
Hitesh Methani, modificado 10 Anos atrás.

RE: How to get User Name and Password in JSON webservice Call?

Regular Member Postagens: 171 Data de Entrada: 24/06/10 Postagens Recentes
Hello Bharat,

Not sure, but you can try disabling password encryption from portal-ext.properties.
Add this property passwords.encryption.algorithm=NONE in your portal-ext.properties and try for new user created after adding this property.

Thanks,
Hitesh Methani.
thumbnail
Tomáš Polešovský, modificado 10 Anos atrás.

RE: How to get User Name and Password in JSON webservice Call?

Liferay Master Postagens: 676 Data de Entrada: 13/02/09 Postagens Recentes
I know 2 ways:
1, setup some kind of SSO and use the user's authenticity token (whatever it is) instead of the password
2, create a trust between the external system and your application so that you don't need to provide the password of the user