Skip to Content
avatar image
Former Member

Deploying a custom login module to the J2EE engine

I have developed a custom login module, and want to deploy it to the SAP j2ee engine. How should I go about this ? I tried packaging it as a jar and then using the deploytool, went into user management to register the module, but when the module was invoked I got an error in the log saying "Cannot load a login module".

The way I currently deploy it is packaged with the Example Calculator, and this works. I just add my 2 java files into the web module (in com.sap.examples.calculator.beans) and it gets packaged in the war file.

Can anyone help with the "proper" way of deploying my module ?

Thanks in advance

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jul 09, 2004 at 08:58 AM

    Hi Brad,

    deploying the login module as a library is the right way to go. As I see from your post you've done everything, except that you are missing a reference from you application to the library that contains the login module. You can set the reference using the application-j2ee-engine.xml of your application (you need to redeploy the app after you change it). Here is a description of how to do that using the NW Developer Studio: http://help.sap.com/saphelp_nw04/helpdata/en/53/69662514eb6e46b1eb6e77ae5cf10b/frameset.htm

    Hope that helps!

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Brad,

      >

      > What I'm actually trying to do is NOT deploy my

      > custom login module with an application. But rather

      > deploy the jar file as a library to the J2EE engine,

      > so that any application can use it by configuring it

      > in their login stacks. I'm still not totally clear

      > whether this is possible or not.

      Once again - It is possible to deploy the login module as a library to the J2EE Engine; furthermore, this is the PREFERRED way to use login modules!

      >

      > What I have currently done:

      >

      > 1. developed custom login module packaged as a jar in

      > NW studio (2 class files)

      >

      > 2. Using deploytool I deploy the jar as a library to

      > the j2ee engine. This works and the library shows up

      > under the libraries section.

      >

      > 3. Register the login module in the user

      > management->manage security stores section. I'm

      > unsure if this works properly. Do I just provide the

      > full path to the required class ? For example

      > "com.example.myloginmodule.LoginModule"

      > I have a suspicion that my error of "cannot load a

      > login module" stems from here.

      >

      > 4. I have then followed your step and added a

      > reference to the libray (Hard reference) and this

      > seems ok.

      >

      Sorry, Brad, I've made a mistake here. You need to set a reference from the Security Provider Service to the library that contains the login module (not from the application). To do that at runtime, you'll have to use the Configuration Adapter service on the J2EE Engine. For a description of the procedure, see this page in the documentation: http://help.sap.com/saphelp_nw04/helpdata/en/dd/1e3a3e5069eb6ce10000000a114084/frameset.htm

      You need to provide additional entry of the following type in the security-provider.xml file:

      <reference type="library" strength="weak">

      Your-library-name-here

      </reference>

      Regards,

      Ivo.

      Message was edited by: Ivaylo Ivanov

  • avatar image
    Former Member
    Jul 12, 2004 at 10:00 AM

    Hi Brad,

    A tutorial is being prepared for exactly the scenario you are working with. It will become part of the official documentation. Before that you can do the following:

    1. deploy the login module(s) within a library (you already have done this)

    2. add the class loader name of this library in Security Provider property "LoginModuleClassLoaders", for example "library:my-library"

    3. register the login module(s) in security service in UME User Store, or switch of verifying of authentication stacks during deployment (switch Security Provider service property "VerifyLoginModulesOnDeploy" to "false")

    4. deploy the application with the login modules specified in web-j2ee-enigne.xml

    5. now it should be ok.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Wentao,

      sorry for being a bit late with my reply but I was on a short vacation.

      Anyway, I don't believe that adding the reference to the security-provider.xml can cause the problem you get.

      Your guess that the XML is stored in the DB is correct. Even if you are unable to log on through the Visual Administrator, you can open the security-provider.xml for editing using the configuration editor from the Config tool. You must do the following:

      1. Stop the dispatcher and server processes (However, <b>the DB must be online</b>).

      2. Launch the Config tool using the <drive>:\usr\sap\J2E\JC00\j2ee\configtool\configtool.bat

      3. Choose File -> Configuration Editor from the main menu of the tool. Now you get the same editor as in the Configuration Adapter service in the Visual Administrator. You know how to locate the security-provider.xml - check if there's anything wrong in there.

      Hope that helps!

      Regards,

      Ivo