Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
biswajit sarkar
Get Loggedin User's plainText Password
7. April 2013 04:54
Antwort

biswajit sarkar

Rang: Regular Member

Nachrichten: 166

Eintrittsdatum: 17. Oktober 2011

Neue Beiträge

I am trying to get plain test password of a loggedin user.
In lots of thread i find below solution

set thies in portal-ext
1session.store.password=true
2session.shared.attributes.excludes=


and also try to get the password from session using this code

1FacesContext fc = FacesContext.getCurrentInstance();
2           ExternalContext externalContext = fc.getExternalContext();
3           PortletRequest req = (PortletRequest) fc.getExternalContext().getRequest();
4       PortletSession ps = req.getPortletSession();
5           System.out.println(ps.getAttribute("USER_PASSWORD"));


But it always retun null.

does anyone have any solution??
I am using jsf to create my portlet
Apoorva Prakash
RE: Get Loggedin User's plainText Password
6. April 2013 04:40
Antwort

Apoorva Prakash

Rang: Liferay Master

Nachrichten: 659

Eintrittsdatum: 15. Juni 2010

Neue Beiträge

biswajit sarkar:
I am trying to get plain test password of a loggedin user.
In lots of thread i find below solution

set thies in portal-ext
1session.store.password=true
2session.shared.attributes.excludes=


and also try to get the password from session using this code

1FacesContext fc = FacesContext.getCurrentInstance();
2           ExternalContext externalContext = fc.getExternalContext();
3           PortletRequest req = (PortletRequest) fc.getExternalContext().getRequest();
4       PortletSession ps = req.getPortletSession();
5           System.out.println(ps.getAttribute("USER_PASSWORD"));


But it always retun null.

does anyone have any solution??
I am using jsf to create my portlet


Hello Bishwajeet,

You cannot decode the password stored by Liferay, because it use SHA algorithm by default, which is irreversible.

But you can use one of the following properties in your portal-ext.properties for overriding the default settings. You'll need to set NONE if you don't want to encode the password.
 1#
 2    # Set the following encryption algorithm to encrypt passwords. The default
 3    # algorithm is SHA (SHA-1). If set to NONE, passwords are stored in the
 4    # database as plain text. The SHA-512 algorithm is currently unsupported.
 5    #
 6    #passwords.encryption.algorithm=BCRYPT
 7    #passwords.encryption.algorithm=UFC-CRYPT
 8    #passwords.encryption.algorithm=MD2
 9    #passwords.encryption.algorithm=MD5
10    #passwords.encryption.algorithm=NONE
11    passwords.encryption.algorithm=SHA
12    #passwords.encryption.algorithm=SHA-256
13    #passwords.encryption.algorithm=SHA-384
14    #passwords.encryption.algorithm=SSHA


HTH.

Thanks and Regards,
Apoorva Prakash