3 Replies Latest reply on Jan 8, 2013 9:01 PM by VatsalGupta

    How to inject TokenAuthenticationHandler object in custom AuthenticationHandler?

    VatsalGupta

      Hi all,

       

      I have requirement to get the user logged-in in CQ from encrypted password. In order to achieve this, I have created a custom authentication handler is to decrypt user's encrypted password and then generate AuthenticationInfo Map for authentication. So I have overrided extractCredentials method to solve this problem.

      I need to inject TokenAuthenticationHandler object in my custom CustomAuthenticationHandler which implements AuthenticationHandler.

      I require this to call the authenticationSucceeded method of TokenAuthenticationHandler in my custom AuthenticationFeedbackHandler to generate login-token cookie for CQ authentication.

      I tried to inject TokenAuthenticationHandler as service by reference but dint work. I also tried to inject by interface AuthenticationHandler which always injects Day CQ LoginSelectorHandler.

      I also tried to extend my CustomAuthenticationHandler to TokenAuthenticationHandler in order to call its authenticationSucceeded method. The call does takes place, but it refers to attributes of my CustomAuthenticationHandler instead of TokenAuthenticationHandler.

       

      So I am not able to successfully call the authenticationSucceeded method of TokenAuthenticationHandler to generate login-token.

       

      Any way to inject TokenAuthenticationHandler in my custom Authentication Handler will be really helpful.

      Any other solution/approach to decrypt password and get the user login in CQ will also be helpful.

       

      Thanks,

      Vatsal