on 03-26-2009 9:53 AM
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.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.