How to get LoginContext object in Custom Authentication Handler? | Community
Skip to main content
August 22, 2016

How to get LoginContext object in Custom Authentication Handler?

  • August 22, 2016
  • 2 replies
  • 7817 views

Hi Experts,

I am writing an Custom Authentication handler in AEM in order to achieve the SSO functionality with Kerberos token. The code to decode the service token needs the LoginContext object. Below is the sample code

 this.loginContext = new JaasLoginContext("jackrabbit.oak", handler);

this.loginContext.login();

when i am trying to execute the above code i am getting below error 

javax.security.auth.login.LoginException: unable to find LoginModule class: org.apache.felix.jaas.boot.ProxyLoginModule
    at javax.security.auth.login.LoginContext.invoke(Unknown Source)
    at javax.security.auth.login.LoginContext.access$000(Unknown Source)
    at javax.security.auth.login.LoginContext$4.run(Unknown Source)

Can you guys help in understanding how to get the LoginContext object in Custom Authentication Handler sample code would be rally helpful?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

smacdonald2008
August 22, 2016

I am checking to see if there are some examples within Adobe that can help you.

smacdonald2008
August 22, 2016

I got a reply on this --- 

Custom action should be probably implemented in custom login module

http://jackrabbit.apache.org/oak/docs/security/authentication.html#JAAS_Authentication_and_Login_Modules

KishCq5Author
September 7, 2016

Thanks for the response Samc. I tried various options but my main goal is achieve Kerberos authentication in AEM. IIS will do the Authentication part and pass the Authorization header Negotiate service token to AEM. the login module which i am trying to write should decrypt the service token. i am stuck at getting the logincontext object which talks to KDC and authenticates the service account of windows server. Need pointers in achieving the  same in AEM.

i tried implementing SSO in tomcat using the SPNEGO module which works fine. while running on tomcat the login module used to authenticate the user with KDC is using com.sun.security.auth.module.Krb5LoginModule.java . As this module is not registered in AEM i tried to write new JAAS Login module but i am not able to write the custom logic of authentication with KDC . Need pointers in implementing the same.

December 14, 2017

Hey Kish any chance you ever got this working?  We're looking at a similar option using Kerberos.  If you did... Do you have a sample/example?