Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Unable to login cq instance

Avatar

Avatar
Validate 10
Level 2
rahul_kumar11
Level 2

Likes

3 likes

Total Posts

36 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 2
rahul_kumar11
Level 2

Likes

3 likes

Total Posts

36 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
View profile
rahul_kumar11
Level 2

15-10-2015

I have requirement to change password implimentation on our project.

took password fields  with new component after entering password fields and after submition  am sending these values through ajax to servlet. the below code i have used .

try {

        Session session = repository.loginAdministrative(null);
            String name = request.getParameter("userID");

        
            String passwordOld = request.getParameter("password");

            String passwordNew = request.getParameter("Changepassword");
        
            
            User user;
   
            UserManager userManager = AccessControlUtil.getUserManager(session);

            Authorizable authorizable = userManager.getAuthorizable(name);
 
            if (authorizable instanceof User) {            
   
                user = (User) authorizable;
                user.changePassword(passwordNew);

            } else {

                throw new ResourceNotFoundException(

                "User could not be determined");

            }
            
            
  
        }

        catch (Exception e) {

            log.error("------------ ---------changePasswordForUser fianl exception.---------------------"
                    + e.getMessage());

        }

I have build the bundle after logout and tried with default user logins but unable to login cq page.

Getting this errors

org.apache.sling.auth.core.impl.SlingAuthenticator getAnonymousResolver: Anonymous access not allowed by configuration - requesting credentials
org.apache.sling.auth.core.impl.SlingAuthenticator handleLoginFailure: Unable to authenticate null: UserId/Password mismatch.

 

That will be great help of your precious help.

 

Thanks,

Rahul.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 25
Level 6
Mshajiahmed
Level 6

Likes

15 likes

Total Posts

331 posts

Correct Reply

126 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Validate 25
Level 6
Mshajiahmed
Level 6

Likes

15 likes

Total Posts

331 posts

Correct Reply

126 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
Mshajiahmed
Level 6

15-10-2015

It seems that you haven't saved session, make a call to session.save()  in your code then try again

Answers (0)