Login module for the J2EE application

Hi ,
I am trying to use the BasicPasswordLoginModule for my J2EE application which will be deployed in the SAP J2EE engine.My application will not be accessed through the portal.
I am having a login screen in my application for which i want to use the already avaliable login module. ie.. BasicPasswordLoginModule.
When i am trying to get the login(). i am getting the following the error.
"javax.security.auth.login.LoginException: No LoginModules configured for BasicPasswordLoginModule".
Please let me know what needs to be done.
PS: The version environment is CE 7.1
Regards
Abu Bakar

Hi Julius
I am totally confused, my application is a pure J2EE application which has only one screen which just displays the details. And i want only the login screen to be implemented. I have gone through a couple of dec from sap which tells to created a custom login module if requiredl but i want to user the FORM based authentication and use the BasicPasswordLoginModule(in-built in WAS)
All that i am doing is written a web.xml with the following information:
<login-config>
   <auth-method>FORM</auth-method>
   <form-login-config>
   <form-login-page>/home.jsp</form-login-page>
   <form-error-page>/relogin.jsp</form-error-page>
   </form-login-config>
  </login-config>
  <security-role>
    <role-name>App_Viewer</role-name>
  </security-role>
web-j2ee-engine with following information:
<security-role-map>
          <role-name>App_Viewer</role-name>
           <server-role-name>Administrator</server-role-name>
     </security-role-map>
     <login-module-configuration>
     <login-module-stack>
     <!-- Contains all login modules used for authentication -->
          <login-module>
          <!-- Contains information about one login module -->
               <login-module-name>BasicPasswordLoginModule</login-module-name>
               <flag>SUFFICIENT</flag>
               <options>
                    <option>
                    <!-- The option UserNamePrefix determines that the user name must start with "Admin" -->
                    <name>UserNamePrefix</name>
                    <value>Admin</value>
                    </option>
               </options>
          </login-module>
     </login-module-stack>
     <security-policy-domain></security-policy-domain>
</login-module-configuration>
And I am not sure, if the above mentioned details are enough. My implementation code is as follows:
try {
          HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
          HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
          request.setAttribute(ILoginConstants.LOGON_UID_ALIAS, this.getUserName());
          request.setAttribute(ILoginConstants.LOGON_PWD_ALIAS, this.getPassword());
          UMFactory.getLogonAuthenticator().logon(request, response, "BasicPasswordLoginModule");
          status = success;
     } catch (Exception e) {
          e.printStackTrace();
          status = e.toString();
In the NWA i have just configured the UserNamePrefix with Admin, thats all . Since the form login authentication method is already configure with the BasicPasswordLoginModule, I left it untouched.
I also implemented a custom login module and deployed it but not sure how to use it in my code.
Please let me know if i am in the rite track. Correct me if i am wrong. At the end of the day i want to use the login screen just to get authenticated. I am also not bothered about the password changing etc.. As the users who are going to use my application are the users in the Identity Management. Few portions of my screen should be allowed to be displayed based on the roles.
PS: My application is not configured in the portal. Its an independent application deployed on the WAS(CE 7.1).
Please advice
Regards
Abu Bakar

Similar Messages

  • 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

    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

  • Custom Login Module Break COTS J2EE Application

    I'm using a custom login module to authenticate users of a COTS J2EE application. The authentication works like a charm, but the COTS app breaks because it uses request.getRemoteUser() to obtain the user name for database lookups.
    When the custom login is in use, request.getRemoteUser() returns "[JAZNUserAdaptor: user=theuser]" instead of simply the user name (this differs from the standard XML provider, which returns only the user name).
    I used the sample login module from the Oracle documentation almost verbatim, the method is included below.
    Does anyone know why getRemoteUser() returns "[JAZNUserAdaptor: user=theuser]" and not just the user name? And how to make it stop doing that?
    Thanks in advance... any input is is greatly appreciated, of course.
         public boolean login() throws LoginException {
                   throw new LoginException("Error: no CallbackHandler available "
                             + "to garner authentication information from the user");
              // Setup default callback handlers.
              Callback[] callbacks = new Callback[] { new NameCallback("Username: "),
                        new PasswordCallback("Password: ", false) };
              try {
                   _callbackHandler.handle(callbacks);
              } catch (Exception e) {
                   _succeeded = false;
                   throw new LoginException(e.getMessage());
              String username = ((NameCallback) callbacks[0]).getName();
              String password = new String(((PasswordCallback) callbacks[1]).getPassword());
              if (isValidUser(username, password)) {
                   _succeeded = true;
                   _password = password.toCharArray();
                   _name = username;
         _authPrincipals = new CMPrincipal[2];
         authPrincipals[0] = new CMPrincipal(name);
         _authPrincipals[1] = new CMPrincipal("SecurityRole");
              ((PasswordCallback) callbacks[1]).clearPassword();
              callbacks[0] = null;
              callbacks[1] = null;
              if (!_succeeded) {
                   System.out.println("login did not succeed... throwing LoginException...");
                   throw new LoginException("Authentication failed: Password does not match");
              return true;
         }

    I know getUserPrincipal().getName() works, but since the J2EE application is a COTS product, I can't change the source code. I'm trying to get the vendor to make that change and release a patch. I was looking for something I might be able to do on my end to get the code to work.
    Thanks for the help.

  • Users for the j2ee application

    hi friends,
    i want to create the users for J2EE applications.
    can i create the users only for j2ee engine ?
    how can i create these users?
    if i want to implement the sap
    is it necessary to buy the licence for j2ee users?
    thanks&regards,
    srinivas.

    Hi
    To create the users in J2EE applications is not an issue, but the licensing is always applicable as it is applicable for ABAP applications.
    There are two ways depends on configurations:
    1. If the UME store is ABAP, then you can create the users at ABAP side using SU01 and at java side using http://<hostname>:5<Systemnumber>00/useradmin
    2. If the UME store is JAVA, then you can only create using http://<hostname>:5<Systemnumber>00/useradmin
    The licensing for JAVA applications depends as ABAP is having, if you use it as production you have to pay the charges. Please contact your local SAP representative for further details

  • SAP PI 7.1 "How Tou2026 Create Modules for the J2EE Adapter Engine"

    Hi everybody,
    is the How To
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/02706f11-0d01-0010-e5ae-ac25e74c4c81?overridelayout=true
    still applicable for 7.1?
    Reason: out admin cant find:
    u2022     aii_af_lib.sda
    u2022     aii_af_svc.sda
    u2022     aii_af_cpa_svc.sda
    on the java stack.
    Thanks Regards
    Mario

    This is for PI 7.1:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e6747fa?overridelayout=true

  • Custom Login Module for EP7

    Hello Experts,
    i have a requirement to develop a custom Login Module for EP7. I am fine with the programming part and on this side everything should be fine. I am puzzling about the configuration. My LoginModule is configured according to this link: [SAP HELP|http://help.sap.com/saphelp_nw2004s/helpdata/en/46/3ce9402f3f8031e10000000a1550b0/content.htm]. But when i configure sap.com/irj*irj in SecurityProvider in Visual Admin, the changes do not take affect. I restarted the portal as well as the Server. I am on NW2004s SP 14.
    What am I missing.
    Thanks for any help,
    best Regards,
    Rene

    Hello Laura,
    thank you for your reply. I have read you link and I doubt that this is the solution. In authschemes.xml you define the user interface for authentication and priority. In Visual admin, you can define the loginModule for your Scheme. But this must be possible without defining an authscheme. Am I right? In my understanding you only have to declare the loginmodule for the application in Visual Admin. And thats it.
    So what i have to do to change the login module for the Portal (irj).
    Any help will be appreciated,
    best regards,
    Rene

  • JAAS login module configuration in Oracle application server

    I have a LDAP login module implementing javax.security.auth.spi.LoginModule. This login module works well with tomcat and weblogic, if I configure the JVM arguments -Djava.security.auth.login.config and -Djava.security.policy to pont to the login.conf and access.policy files. The login.conf file has the below content
    FREEWAY_SERV
    com.wipro.freeway.security.LdapLoginModule required debug=true portal=false;
    FREEWAY_PORT
    com.wipro.freeway.security.LdapLoginModule required debug=true portal=true;
    The application uses these login modules by passing Name of the JAAS configuration (FREEWAY_SERV or FREEWAY_PORT).
    I would like to use the same login modules and code in Oracle application sever 10.1.3 and I haven't got any success yet.
    Could anybody please help me to get this right?
    Thanks in advance.
    Message was edited by:
    vinayalva

    Hi,
    in OracleAs bet is to use Enterprise Manager to configure the login module. The LoginModule needs to be configured in the system-jazn-data.xml file, which is located in teh j2ee/home/config directory of the OC4J you use. Enterprise Manager does this all for you.
    In your application deployment the orion-application.xml file needs to specify that a custom LoginModule should be used. Again ENterprise Manager does it for you.
    To use the LoginModule e.d. for J2EE authentication, just make sure that the application name of the J2EE deployment matches the name of the LoginModule configuration
    If you want to use pure JAAS you may have to change the OC4J properties file in the j2ee/home/config directory. Best suggestion to give is to get the online documentation for OC4J security
    Frank

  • How to configure login modules for certificate logon

    Hello,
    perhaps someone of you has also tried to implement SSO via Client Certificates and is able to help me...
    I have configured the login modules for rule based authentication with the option Rule1.getUserFrom = wholeCert and I have attached my certificate to my user in useradmin.
    And also added the login module to the template ticket, as suggested by the documentation at help.sap.com
    But when I logon to the portal or other application (for example useradmin) via https the authentication doesn't work (but I'm still able to logon via password).
    I also tried auto. certifcate mapping and mapping by subject name but in every case the system ignores the configured login module. There are no errors in the log files.
    Thank You,
    Frank

    Hi Frank,
    did you configure the SSO for an individual policy configuration or did you edit and save the changes the ticket policy config? I ask, b/c if you applied the changes to the individual policy config then the SSO with certificates will be used <b>only</b> when you access the applications for that policy config.
    You can also double check the login module flags - perhaps the authentication check doesn't reach the ClientCertLM at all.
    Since you followed the help portal instruction I assume you've enabled strong crypto - it is required for client cert SSO. Ano easily committed mistake is to also not use the HTTPS port in the access URL.
    Let me know if this helps...
    Yonko

  • Question about the choice of containers of the J2EE application server

    Hello,
    I need to be clarified about the J2EE technology. After read some documentation about J2EE, I saw that it is possible to use different kind of containers in order to develop a J2EE application.
    Actually I use an application server (JONAS) with tomcat embbeded so I develop my application that is composed by EJB and servlet. So when I build and deploy my application at the end I have got a .ear, and everything works well.
    But my questions are:
    1- If I installe a J2EE server where a web server (Tomcat or another) is already installed can I use this web server as my web container.
    2- If it is possible how can I indicate to my J2EE server that I want to use this web server as a web container?
    3- And for my application does the .ear will work or do I have to split my entire application in .jar for the EJB and .WAR for the servlet.
    4- My last question, how my .war and .jar will know that they have to work together, in fact do I have to precise a link between them if yes how?
    Thank you very much for any information

    1. Every J2EE server must have a web container, so one will always be installed. As long as you write a compliant .war that is deployed either stand-alone or as part of an .ear, you can be guaranteed it will deploy and run.
    2. The fact that you are deploying a .war or an .ear that contains 1 or more .wars is enough for the J2EE product to know you need to run the web-application on the web container. Many people uses the terms
    web server and web container interchangeably. Often people are more likely to use the term web server if it runs as a separate process. If it helps, you can think of the J2EE web container as being an implementation of a servlet and jsp container that runs on top of a regular HTTP engine, but J2EE vendors don't necessarily have to have separate products for each.
    3. You can either deploy a standalone .war or embed 1 or more .wars within an .ear.
    4. The fact that you have a .war and an ejb-jar within the same .ear tells the application
    server that they're part of the same application. If you need to talk between your web application
    and the ejb, there are number of ways to express that dependency. E.g., if you want to invoke on
    an ejb through its Remote client view, you would define an ejb-ref in the environment of the web-application.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Remote enabled FM for the Portal application

    Dear all,
    I need to develop a Remote enabled FM for the Portal application. The requirement is to pass the output( few fileds) of MC.1 Transaction to the portal.The issue is whether to write our own logic in the function module or is there any alternative way.
    The input is same as for the std tarnsaction MC.1
    Thanks
    Kumar

    Yes you will have to create a Z function module.
    Instead of declaring the function module as normal function module in the attributes tab, mention it as remote function module.
    Also when giving import and export parameters select the pass value check box.
    This might solve your query.
    Thanks & Regards,
    Lalit Mohan Gupta.

  • Trying to call a Webservice - "Settings for the J2EE Server do not exist."

    Hi, we're on SAP ECC 6.0 and I'm trying to get access to a webservice:
    BAPI converted to Webservice ok
    Webservice activated ok
    http active ok
    WSADMIN - click on the WSDL button - browser launches, user id requested, userid given, WSDL displays perfect! Even tested from the outside.
    WSADMIN - click on the Web service homepage - Settings for WDSL generation (RPC or Document style, same result) - Error - "Settings for the J2EE Server do not exist."
    Internet browesr - I go to the URL for the WSDL - works again perfect!
    Internet browesr - I go to the URL  - error ! <faultstring xml:lang="en">SOAP processing failure, error id = 112 </faultstring>
    Are the two errors the same?
    Do I have to have a J2EE server to enable Webservices?
    Is this a complex system change?
    Is there a workaround?
    Thanks for any tips on getting Webservice to function
    Philip

    hi,
    when the WAS ABAP has a webserver running and the WSDL service up and running (WSDLs are created dynamically) you get the WSDL served from WAS ABAP.
    "Webservice homepage" is an application written in Java and running on WAS Java., So, if you want to use that application you have to have a WAS JAVA up and running, you have to have the application 'Webservice homepage' up and running and of course on WAS ABAP you have to have the URL of the WAS JAVA specified to enable the WSADMIN function to link you to the Java app.
    Most probably you do not even have a WAS Java running and/or the application 'webservice homepage" not set up. Either way, in my opinion the application "webservice homepage" is crap anyway (because it is not really independent. if SAP implements something strangely on the server side they of course implement it the same way on the client/testing side, so you never find out that in real world scenarios e.g. no client understands the feature X the way SAP implemented it). use any non-SAP-tool to test your SAP webservices, e.g. XML Spy, or SOAPUI.
    my 2 cents,
    anton

  • Custom login module for EP7.4 with Captcha

    Hi
    I am trying to create a custom login module which validates the captcha shown at the login screen using SAP help link:
    http://help.sap.com/saphelp_nw73/helpdata/en/48/ff4faf222b3697e10000000a42189b/content.htm?frameset=/en/48/fcea4f62944e88e10000000a421937/frameset.htm&current_toc=/en/74/8ff534d56846e2abc61fe5612927bf/plain.htm&node_id=20
    The session is being set in the Captcha servlet which is used to render the image on the login page.
    However when I am trying to compare it with input or print the session value, its throwing an exception.
    I checked in the NWA logs and it just shows the following error message:
    6. com.temp.loginModule.MyLoginModuleClass OPTIONAL ok exception true Authentication did not succeed.
    Please help me analyse the error stack. Can someone point where do i check the detailed logs to trace the issue?
    Please find below source of my login module.
    package com.temp.loginModule;
    import java.io.IOException;
    import java.util.Map;
    import javax.security.auth.login.LoginException;
    import javax.security.auth.Subject;
    import javax.security.auth.callback.CallbackHandler;
    import javax.security.auth.callback.Callback;
    import javax.security.auth.callback.NameCallback;
    import javax.security.auth.callback.UnsupportedCallbackException;
    import nl.captcha.Captcha;
    import com.sap.engine.interfaces.security.auth.AbstractLoginModule;
    import com.sap.engine.lib.security.http.HttpGetterCallback;
    import com.sap.engine.lib.security.http.HttpCallback;
    import com.sap.engine.lib.security.LoginExceptionDetails;
    import com.sap.engine.lib.security.Principal;
    public class MyLoginModuleClass extends AbstractLoginModule{
      private CallbackHandler callbackHandler = null;
      private Subject subject = null;
      private Map sharedState = null;
      private Map options = null;
      // This is the name of the user you have created on
      // the AS Java so you can test the login module
      private String userName = null;
      private boolean successful;
      private boolean nameSet;
      public void initialize(Subject subject, CallbackHandler callbackHandler,
      Map sharedState, Map options) {
      // This is the only required step for the method
      super.initialize(subject, callbackHandler, sharedState, options);
      // Initializing the values of the variables
      this.callbackHandler = callbackHandler;
      this.subject = subject;
      this.sharedState = sharedState;
      this.options = options;
      this.successful = false;
      this.nameSet = false;
      * Retrieves the user credentials and checks them. This is
      * the first part of the authentication process.
      public boolean login() throws LoginException {
    // HttpGetterCallback httpGetterCallback = new HttpGetterCallback(); 
    //       httpGetterCallback.setType(HttpCallback.REQUEST_PARAMETER); 
    //       httpGetterCallback.setName("captchaInput"); 
           String value = null; 
    //       try { 
    //       callbackHandler.handle(new Callback[] { httpGetterCallback }); 
    //           String[] arrayRequestparam = (String[]) httpGetterCallback.getValue(); 
    //           if(arrayRequestparam!=null && arrayRequestparam.length>0)
    //           value = arrayRequestparam[0]; 
    //       } catch (UnsupportedCallbackException e) { 
    //       throwNewLoginException("An error occurred while trying to validate credentials."); 
    //       } catch (IOException e) { 
    //            throwUserLoginException(e, LoginExceptionDetails.IO_EXCEPTION); 
      value = getRequestValue("captchaInput");
      userName = getRequestValue("j_username");
      HttpGetterCallback httpGetterCallbackSessionCaptcha = new HttpGetterCallback(); 
      httpGetterCallbackSessionCaptcha.setType(HttpCallback.SESSION_ATTRIBUTE); 
      httpGetterCallbackSessionCaptcha.setName("myCaptchaLogin"); 
      try { 
      callbackHandler.handle(new Callback[] { httpGetterCallbackSessionCaptcha }); 
      Captcha arraySessionParam = (Captcha) httpGetterCallbackSessionCaptcha.getValue();
    // System.out.println("****************************************************httpGetterCallbackSessionCaptcha" + (arraySessionParam==null?"null session":arraySessionParam.getAnswer())+
    // "\n captchaInput" + value+"*********************");
      if(arraySessionParam==null || !arraySessionParam.isCorrect(value)){
      throwNewLoginException("Entered code does not match with the image code.Session:"+(arraySessionParam==null?"null":arraySessionParam.getAnswer())+" Param:"+ value);
    // throwUserLoginException(new Exception("Entered code does not match with the image code."));
      httpGetterCallbackSessionCaptcha.setValue(null);
      } catch (UnsupportedCallbackException e) { 
      throwNewLoginException("An error occurred while trying to validate credentials."); 
      } catch (IOException e) { 
      throwUserLoginException(e, LoginExceptionDetails.IO_EXCEPTION); 
      // Retrieve the user credentials via the callback
      // handler.
      // In this case we get the user name from the HTTP
      // NameCallback.
    // NameCallback nameCallback = new NameCallback("User name: ");
      /* The type and the name specify which part of the HTTP request
      * should be retrieved. For Web container authentication, the
      * supported types are defined in the interface
      * com.sap.engine.lib.security.http.HttpCallback.
      * For programmatical authentication with custom callback
      * handler the supported types depend on the used callback handler.
    // try {
    // callbackHandler.handle(new Callback[] {nameCallback});
    // catch (UnsupportedCallbackException e) {
    // return false;
    // catch (IOException e) {
    // throwUserLoginException(e, LoginExceptionDetails.IO_EXCEPTION);
    // userName = nameCallback.getName();
    // if( userName == null || userName.length() == 0 ) {
    // return false;  
      /* When you know the user name, update the user information
      * using data from the persistence. The operation must
      * be done before the user credentials checks. This method also
      * checks the user name so that if a user with that name does not
      * exist in the active user store, a
      * java.lang.SecurityException is thrown.
    // try {
    // refreshUserInfo(userName);
    // } catch (SecurityException e) {
    // throwUserLoginException(e);
      /* Checks if the given user name starts with the specified
      * prefix in the login module options. If no prefix is specified,
      * then all users are trusted.
    // String prefix = (String) options.get("user_name_prefix");
    // if ((prefix != null) && !userName.startsWith(prefix)) {
    // throwNewLoginException("The user is not trusted.");
      /* This is done if the authentication of the login module is    
      * successful.
      * Only one and exactly one login module from the stack must put
      * the user name in the shared state. This user name represents
      * the authenticated user.
      * For example if the login attempt is successful, method
      * getRemoteUser() of
      * the HTTP request will retrieve exactly this name.
      if (sharedState.get(AbstractLoginModule.NAME) == null) {
      sharedState.put(AbstractLoginModule.NAME, userName);
      nameSet = true;
      successful = true;
      return true;
      * Commit the login. This is the second part of the authentication
      * process.
      * If a user name has been stored by the login() method,
      * the user name is added to the subject as a new principal.
      public boolean commit() throws LoginException {
      if (successful) {
      /* The principals that are added to the subject should
      * implement java.security.Principal.You can use the class
      * com.sap.engine.lib.security.Principal for this purpose.
      Principal principal = new Principal(userName);
      subject.getPrincipals().add(principal);
      /* If the login is successful, then the principal corresponding
      * to the <userName> (the same user name that has been added
      * to the subject) must be added in the shared state too.
      * This principal is considered to be the main principal
      * representing the user.
      * For example, this principal will be retrieved from method
      * getUserPrincipal() of the HTTP request.
      if (nameSet) {
      sharedState.put(AbstractLoginModule.PRINCIPAL, principal);
      } else {
      userName = null;
      return true;
      * Abort the authentication process.
      public boolean abort() throws LoginException {
      if (successful) {
      userName = null;
      successful = false;
      return true;
      * Log out the user. Also removes the principals and
      * destroys or removes the credentials that were associated 
      * with the user during the commit phase.
      public boolean logout() throws LoginException {
      // Remove principals and credentials from subject
      if (successful) {
      subject.getPrincipals(Principal.class).clear();
      successful = false;
      return true;
      private String getRequestValue(String parameterName) 
         throws LoginException { 
           HttpGetterCallback httpGetterCallback = new HttpGetterCallback(); 
           httpGetterCallback.setType(HttpCallback.REQUEST_PARAMETER); 
           httpGetterCallback.setName(parameterName); 
           String value = null; 
           try { 
          callbackHandler.handle(new Callback[] { httpGetterCallback }); 
               String[] arrayRequestparam = (String[]) httpGetterCallback.getValue(); 
               value = arrayRequestparam[0]; 
           } catch (UnsupportedCallbackException e) { 
                return null; 
           } catch (IOException e) { 
                throwUserLoginException(e, LoginExceptionDetails.IO_EXCEPTION); 
           return value; 
    Regards
    Ramanender Singh

    Ramanender,
    JAAS modules usually requires a restart whenever you need to change them. So be very careful with what you expect once you re-deploy your code.
    Once the library is loaded it will never reload itself until you perform a restart of the VM. 
    Connect to the debug port may help, but basic debugging will not take you too far either.
    I would recommend you to use the log tracing facility on your code. Just enter the following class attribute:
    import com.sap.tc.logging.Location;
    private static final Location trace = Location.getLocation(<your_classname_here>.class);
    trace.warningT("Some Warning Text Here..." + variable here);
    trace.debugT("Some Warning Text Here..." + variable here);
    You may need to go NWA and set the Location Severity Level to Debug according to your needs.
    Leave the trace code on your module for IT personnel to debug it if necessary. Don't forget to have the severity level of your code properly set.
    Meaning: You don't want to have every trace message your module sills out with warningT() or infoT().
    There is a excellent blog here on how this works
    Then you will be able to inspect some variable contents while the callbackhandler is being executed.
    Pay special attention with the timing - variables have a lifetime when dealing with login modules.
    Use the entering(<method_name>) and exiting(<method_name> just ot make sure where in the code the variable should be populated and when.
    BR,
    Ivan

  • Custom login module for weblogic portal 10.3.2

    Hi everyone
    i want to develop a custom portal login module for weblogic..
    can anyone help me out with details how can i implement it ...any links provided will ve very useful
    Thanks in advance.

    The credentials given on that page are wrong for 10.3.2. (They might be correct for 10.3, but that's not my problem.) I found the correct credentials -- weblogic / webl0gic -- at this URL:
    weblogic portal 10.3.2 sample domain admin console question
    It's also given correctly in section 6 of the Getting Started Guide, but you have to know to look there first.
    Edited by: dwschulze on Aug 19, 2010 1:47 PM

  • Function modules for the following

    Hi,
    I want to know the function modules for the following purposes.
    1) Check whether a date is valid or not
    2) Calculate the no of days between two dates.
    Expecting an early response.
    Thanks n Regards,
    Amit

    Hi,
    PARAMETERS: p_list LIKE t009b-bumon AS LISTBOX
                         VISIBLE LENGTH 11 OBLIGATORY ,
                p_list1 LIKE t009b-bdatj OBLIGATORY.
    SELECTION-SCREEN POSITION POS_HIGH.
    PARAMETERS: p_list2 LIKE t009b-bumon AS LISTBOX
                          VISIBLE LENGTH 11 OBLIGATORY,
                p_list3 LIKE t009b-bdatj OBLIGATORY.
    Calling Function Module for calculating no of days between the
    selected period
        CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'
             EXPORTING
                  par_month = p_list
                  par_year  = p_list1
             IMPORTING
                  par_days  = ws_n_days.
        CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'
             EXPORTING
                  par_month = p_list2
                  par_year  = p_list3
             IMPORTING
                  par_days  = ws_n_days1.
    For Concatenating the month and year into the date format
        CONCATENATE  p_list1  p_list ws_i INTO ws_c_date1.
        CONCATENATE p_list3  p_list2 ws_n_days1 INTO ws_c_date2.
      date = ws_c_date1 - ws_c_date2.
    In the above sample code the selection screen has month and year as input.
    Also check this link
    http://www.sapdevelopment.co.uk/tips/date/datehome.htm
    Check FM
    <b>RP_CALC_DATE_IN_INTERVAL</b> Add/subtract years/months/days from a date
    <b>SD_DATETIME_DIFFERENCE</b> Give the difference in Days and Time for 2 dates
    <b>Also for checking valid date:</b>
    U can specify the date field as
    Select-options:  s_date like likp-date(similar to ur requirement)
    This itself ceck for the valid date no seperate validation needed.
    Thanks & Regards,
    Judith.

  • How to set the icon for the entire application with JFrame.setIconImage

    I set the icon on the main frame using JFrame.setIconImage(). The icon is shown properly in the main frame.
    If more JFrames are opened from the main frame, the newly opened JFrames also show the icon.
    However if JDialogs are opended, in some cases the icon set on the main frame is shown and in other cases the coffee cup.
    What is JFrame.setIconImage() expected to do? Setting the icon for a single JFrame or the entire application?
    How can I set the icon for the entire application?
    How can I set the icon for JDialogs?
    Thank you

    In order for your dialogs to use the same icon as the frame, you must parent the dialogs to the frame which has the custom icon.
    See the following thread for more information: http://forum.java.sun.com/thread.jsp?forum=57&thread=362542
    cheers,
    Greg

Maybe you are looking for

  • Asset GR & GI Problem

    Hi all I have created an asset PO for 1 computer by assigning A as a Account assignment Category. I have given the asset number and order number(single assignement) in accout assigment tab to which 1 computer is to be issued. I made GR for 1 computer

  • How to change alpha of an array?

    It's me again. I am trying to dynamically change the alpha value of a set of movieclips on a timer.  The timer works but I get an error message from the function.      This is the error: TypeError: Error #1010: A term is undefined and has no properti

  • Need simple progress bar

    Hi... I have a GUI which calls methods in different classes. There are three long running tasks, which I want to be able to display the progress of. Each task MUST finish before the other proceeds, so I don't think it is necessary for more than one t

  • Set Computer name by computers serial number ?

    Hi guys! I need a simple script or something to set computer name(serial number) and add computer to our domain. Computer name should be for laptop, LT-"serialno" and for Desktop it should be DT-"serialno" Is there a simple way to fix this? I have tr

  • How to install Lion on Mac with slow internet connection.

    My father's Mac mini has a slow internet connection.  I always update it by taking the update packages that I download on my iMac to his machine.  Will I be able to do that with 10.7 (Lion) when it is purchased/downloaded from the Mac App Store?