cancel
Showing results for 
Search instead for 
Did you mean: 

Can't find LoginModule

Former Member
0 Kudos

Hi all,

I can't seem to use the BasicPasswordLoginModule that is preconfigured in the J2EE engine. Here is what I have done:

1. Succesfully deployed the app that wants to use the login module.

2. Used the Visual Admin's Security Provider to associate the existing BasicPasswordLoginModule to both the Web and EJB components.

3. Try to programatically create a LoginContext from within the container (in a servlet, for instance). I am using the following code :

LoginContext = new

LoginContext("BasicPasswordLoginModule",cbHandler);

At this point I get the following error :

javax.security.auth.login.LoginException: No LoginModules configured for BasicPasswordLoginModule

at javax.security.auth.login.LoginContext.init(LoginContext.java:189)

at javax.security.auth.login.LoginContext.<init>(LoginContext.java:404)

at ......

What am I missing?

TIA,

Chad

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

i am also facing same problem. I searched a lot on SAP forums but all this type of questions are still unanswered.

I hav implemented standard java LoginModule class.

Then created its library and deploy it according steps given in SAP Help.

Then referered it in my Applcation's servlet page as

LoginContext loginContext = new LoginContext("MyLoginModule", callbackHandler);

But still it is giving <b>loginException</b>:

javax.security.auth.login.LoginException: No LoginModules configured for MyLoginModule
 at javax.security.auth.login.LoginContext.init(LoginContext.java:189) 
at javax.security.auth.login.LoginContext.(LoginContext.java:404)

Can anyone help me. Its very very urgent for me.

Former Member
0 Kudos

It seems that you should use policy configuration instead of login module name in your code.

Step by step:

1. You have to create new policy configuration using:

Visual Administrator - Server - Services - Security Provider - choose Add button in the "Components" frame - Enter the name of new policy configuration e.g."test" - choose Add new button in the Authentication frame - choose your Login module (I supposed you have registered your login module on J2EE correctly)

2. Use policy configuration name "test" in your code:

LoginContext loginContext = new LoginContext("test", callbackHandler);

I hope it helps