cancel
Showing results for 
Search instead for 
Did you mean: 

create jsp for Custom login module(JAAS)

Former Member
0 Kudos

Hi all,

help me, how to call the custom login module from jsp page.

i want to send username, password to custom login module for authentication.

what is procedure and if u have code for jsp to calling that class . please post that.

iam waiting for reply.

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

You have two alternatives to do this:

You can declare your JSP as a protected resource with the use of the deployment descriptors of the application (web.xml) and add the custom login module in the authentication stack of the application. This way, you will use container-based authentication, i.e. the Web Container will enforce the authentication and it will call the custom login module before it dispatches to the JSP. I recommend you this approach because it requires less coding and it makes the whole thing a matter of configuration. The configuration can be later on enhanced or changed runtime without the need to re-build and re-deploy the application. If you choose this approach you can go to the documentation of the server for help on how to modify the login module stack of the application.

You can also use programmatic authentication by using JAAS API. To do this you need to create a custom security policy configuration with login module stack containing the custom login module, and then use the standard JAAS mechanism - new LoginContext(<configuration>, <callback-handler>).login(). This approach requires that you write your own callback handler and handle any LoginException.

Let us know which approach you prefer and whether you have difficulties implementing it!

Former Member
0 Kudos

Hi , i created custom login module and cconfigured in server.

And then in jsp i given in security as developed custom login module class name.

But it is not working.

Is there any document or any blogs to follow and sucess the login to portal using the jsp with custom login module.

0 Kudos

I do not understand what you mean by "i given in security as developed custom login module class name". What exactly do you do? Can you copy your coding here?

Please, let me know whether you want to use the declarative or programmatic approach so that I can refer you to the appropriate documentation.

Former Member
0 Kudos

Hey, I'm interested in some documentation in the declarative approach to calling my LoginModule. I'm also having some trouble with getting everything working and understanding how it gets called.

Thanks