Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

Change Password

Avatar

Level 2

Hi all,

My website requires user to log in to view the site. I have created a login and logout module. All is working fine. The problem I am having now is my change password function. My code for change password

Authorizable authorizable = am.findAccount(name); if (authorizable!=null && authorizable.isUser()) { user = (User)authorizable; log.info("user id: " + user.getID()); user.changePassword(pwd); log.info("password changed"); }

Then it will redirect:

if (path.indexOf(".")<0) { path += ".html"; } response.sendRedirect(path);

But every time I change password, I get page error 401. 

*INFO* [0:0:0:0:0:0:0:1 [1375326294129] GET /content/test/successful.html HTTP/1.1] org.apache.sling.commons.auth.impl.SlingAuthenticator handleLoginFailure: Unable to authenticate test_user: null *INFO* [0:0:0:0:0:0:0:1 [1375326294129] GET /content/test/successful.html HTTP/1.1] org.apache.sling.commons.auth.impl.SlingAuthenticator login: No handler for request (3 handlers available) *ERROR* [0:0:0:0:0:0:0:1 [1375326294129] GET /content/test/successful.html HTTP/1.1] org.apache.sling.commons.auth.impl.SlingAuthenticator doLogin: Cannot login: No AuthenticationHandler available to handle the request 

I am using CQ5.3

1 Accepted Solution

Avatar

Correct answer by
Level 5

Can you make sure that /content/test/successful.html  has anonymous access. Also how many publish instance you have ? It might possible that you are changing password in one instance and request to /content/test/successful.html is going to another instance where password is not changed.

Yogesh

View solution in original post

5 Replies

Avatar

Correct answer by
Level 5

Can you make sure that /content/test/successful.html  has anonymous access. Also how many publish instance you have ? It might possible that you are changing password in one instance and request to /content/test/successful.html is going to another instance where password is not changed.

Yogesh

Avatar

Level 2

Sorry forgot to mention I am using CQ5.3. The above link is for CQ5.5 only.

Avatar

Level 4

ChagePassword is plain one...Password encryption is happening for you?