Implementing JAAS  Help

Hi All Dear ones
I am trying to implement a standalone Java application using JAAS. I tried samples but i am unable to understand. Please help me to get some good tutorial for JAAS and some sample.
This is my id [email protected]

Please provide me with a reply as this is an urgent situation.
Thanks in advance,
Geet

Similar Messages

  • How to implement JAAS?�?

    Hi all,
    I'm building a web application using JSP and Sevlet, and I want to design a login page where users enter their name and pass. I heared that if I want to design that page I need to implement JAAS (Java Authentication and Authorization Service) please help me to do that and give me code, links, or articles that talk about design login pages.
    thanx,

    Some examples to help you get started...
    Extracts from web.xml
        <!-- My App uses Struts - declare the struts action servlet -->
        <servlet> 
            <servlet-name>action</servlet-name>
            <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
            <init-param>
                <param-name>config</param-name>
                <param-value>/WEB-INF/config/struts/struts-config.xml</param-value>
            </init-param>
            <init-param>
                <param-name>debug</param-name>
                <param-value>2</param-value>
            </init-param>
            <init-param>
                <param-name>detail</param-name>
                <param-value>2</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>
            <security-role-ref>
                <role-name>member</role-name>
                <role-link>member</role-link>        
            </security-role-ref>
        </servlet>
        <!-- Standard Action Servlet Mapping -->
        <servlet-mapping>
            <servlet-name>action</servlet-name>
            <url-pattern>*.do</url-pattern>
        </servlet-mapping>
        <security-constraint>
            <!-- Member pages can only be accessed by 'members' -->    
            <web-resource-collection>
                <web-resource-name>Member Pages</web-resource-name>
                <url-pattern>/members/*</url-pattern>
                <http-method>GET</http-method>
                <http-method>POST</http-method>                              
            </web-resource-collection>
            <auth-constraint>
                <role-name>member</role-name>
            </auth-constraint>       
            <!-- Forces SSL -->
            <user-data-constraint>           
                <transport-guarantee>CONFIDENTIAL</transport-guarantee>           
            </user-data-constraint>   
        </security-constraint>
        <!-- Specify Form Based Authentication -->
        <login-config>
            <auth-method>FORM</auth-method>       
            <form-login-config>
                <form-login-page>/displayLogin.do</form-login-page>
                <form-error-page>/displayLoginError.do</form-error-page>
            </form-login-config>
        </login-config>
        <security-role>
            <role-name>member</role-name>
        </security-role>
    Login JSP (Uses Struts specific tags which can be ignored)
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="html" uri="http://struts.apache.org/tags-html-el" %>
    <%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean-el" %>
    <form name="LoginForm" action="j_security_check" method="post">
         <table class="TwoColumnForm">     
            <tr>
                <th><bean:message key="user.username"/></th>
                <td><input type="text" name="j_username" class="Required" size="32" maxlength="32"/></td>
            </tr>
            <tr>
                <th><bean:message key="user.password"/></th>
                <td><input type="password" name="j_password" class="Required" size="32" maxlength="32"/></td>
            </tr>        
             <tr>
                 <td Class="Buttons" colspan="2">
                     <html:image styleClass="Button" property="buttons.submit" pageKey="common.img.ok_button.src" alt="common.img.ok_button.alt"/>
                     <html:link page="/displayMain.do"><html:img styleClass="Button" pageKey="common.img.cancel_button.src" altKey="common.img.cancel_button.alt"/></html:link>
                 </td>
             </tr>        
         </table>
    <form>
    Configure Tomcat to use custom JAAS login module - add the following to context.xml in META-INF
    <Context reloadable="true">
         <!-- Realms -->
         <Realm className="org.apache.catalina.realm.JAASRealm" appName="MyApp" userClassNames="com.myapp.security.jaas.CustomUserPrincipal"
              roleClassNames="com.myapp.security.jaas.CustomRolePrincipal" debug="1"/>
         <!-- Monitored Resources -->
         <WatchedResource>META-INF/context.xml</WatchedResource>     
         <WatchedResource>WEB-INF/web.xml</WatchedResource>
    </Context>
    Create a file called jaas.config
    MyApp
        com.myapp.security.jaas.CustomLoginModule required;
    Specify the jaas.config file as a system property when you start you app server
    -Djava.security.auth.login.config=="C:/Projects/MyApp/jaas.config"[b]Implement the CustomLoginModule, CustomUserPrincipal and CustomRolePrincipal as shown in the sun tutorials
    These classes need to be deployed where your application server can find them when it starts up, i.e. outside of your WEB-INF/classes and WEB-INF/lib
    You can implement the CustomLoginModule how you like, but if your application maintains it's own user database it may get a bit messy - I didn't like the idea of the app server interogating my application database and becoming responsible for the login logic (e.g. lock the account after 3 incorrect attempts etc). For this reason my CustomLoginModule (running in Tomcat) invokes a remote login method in my web app over RMI. The login method return a User object if successful which is added to the CustomUserPrincipal so it can be retrieved in the web-app.
    Not the nicest of designs I admit. If anyone can suggest a better approach I'd be glad to hear it. I'm also not a JAAS expert. My app is just for testing out things I'm interested in, it's quite possible I may have misunderstood something along the way.

  • How to implement secure help in SharePoint 2010?

    Hi,
    We are having a sharepoint site running over HTTPS. When I click on help link given on top right side, I get a security warning saying that only secure content content can be displayed. This is probably due to the non secure content(http) used by microsoft
    help.
    Can anyone please suggest how to implement microsoft help having secure content?
    Please see screenshot below:

    Yes office.microsoft.com URL works when I use https:// instead of http:// .
    Can you please let me know in which file this help function is used?
    Please provide me with an example if possible.

  • How to implement Search Help in Interacive Form based on WebDynpro Java?

    Hi Experts,
    How to implement Search Help in Interacive Form based on WebDynpro Java?
    Could someone please provide the prerequisites and the code for the same.
    Regards,
    Shobhit

    Extend the controller and get the handle of the current row of the VO. Set set the attribute context filed accordingly. Also get the handle fo the flexbean and set the context. According rendering would change.
    Regards
    Sumit

  • To implement search help for date and time fields details

    how can i implement search help for date and time fields in screen painter

    Hi
    Declare the variables as sy-datum and sy-uzeit or any other pre-defined data typ of date and ime types. Serach help will automatically comes.
    Aditya

  • How to implement a help feature in iView Tray

    How to implement a help feature in an iView Tray?

    Hi Gregor,
    Could the answer be connected to the class com.sapportals.portal.prt.component.SystemModes ?
    I can't really see how this class is called, but it gives the error message you are talking about
    The method doHelp for SP2 Patch3 is provided below
    public void doHelp(IPortalComponentRequest aRequest, IPortalComponentResponse aResponse)
            IPortalComponentContext context = aRequest.getComponentContext(IPOMConstants.DEFAULT_MODE);
            IPortalComponentProfile profile = context.getProfile();
            String helpName = profile.getProperty("com.sap.portal.iview.HelpName");
            if(helpName == null)
                helpName = profile.getProperty("HelpName");
            String helpURL = profile.getProperty("com.sap.portal.iview.HelpURL");
            String isolationMode = profile.getProperty("com.sap.portal.reserved.iview.IsolationMode");
            if(context != null)
                if(helpName != null)
                    String componentName = context.getComponentName();
                    Locale locale = aRequest.getLocale();
                    String language = locale.getLanguage();
                    String helpPath = "help/" + language + "/" + helpName;
                    IResource resource = aRequest.getResource(componentName, "page", helpPath);
                    if(resource.isAvailable())
                        aResponse.addResource(resource);
                    else
                        aResponse.write("<b>Sorry, no help available.</b>");
                } else
                if(helpURL != null && helpURL.length() > 0)
                    if(helpURL.startsWith("http://"))
                        if(isolationMode != null && isolationMode.equals("URL"))
                            HtmlIFrame frame = new HtmlIFrame();
                            frame.setStyle("width:100%; height: 100%;");
                            frame.setSrc(helpURL);
                            aResponse.write(frame.toString());
                    } else
                        String componentName = null;
                        if(helpURL.charAt(0) != '/')
                            componentName = context.getComponentName();
                        } else
                            int componentNameIndexEnd = helpURL.indexOf('/', 1);
                            componentName = helpURL.substring(1, componentNameIndexEnd);
                            helpURL = helpURL.substring(componentNameIndexEnd);
                        IResource resource = aRequest.getResource(componentName, "page", helpURL);
                        if(resource.isAvailable())
                            aResponse.addResource(resource);
                        else
                            aResponse.write("<b>Sorry, no help available.</b>");
                } else
                    aResponse.write("<b>Sorry, no help available.</b>");
    The doOnNodeReady method is also rather interesting. Perhaps another way to solve it?
    protected void doOnNodeReady(IPortalComponentRequest request, IEvent event)
            NodeMode nodeMode = request.getNode().getNodeMode();
            if(nodeMode == NodeMode.HELP_MODE)
                IPortalComponentContext context = request.getComponentContext(IPOMConstants.DEFAULT_MODE);
                IPortalComponentProfile profile = context.getProfile();
                String helpName = profile.getProperty("com.sap.portal.iview.HelpName");
                if(helpName == null)
                    helpName = profile.getProperty("HelpName");
                String helpURL = profile.getProperty("com.sap.portal.iview.HelpURL");
                String isolationMode = profile.getProperty("com.sap.portal.reserved.iview.IsolationMode");
                if(context != null && helpName == null && helpURL != null && helpURL.length() > 0 && (isolationMode != null && !isolationMode.equals("URL") || isolationMode == null) && helpURL.startsWith("http://"))
                    request.redirect(helpURL);

  • Implementing JAAS for NTLoginModule

    Hi,
    when i am trying to implement JAAS for NTLoginModule , it is directly validating the NTSystem user.
    It is going to the required page.
    it is not prompting me for UserName and Password. how can i set the options so that it should ask me UserName and Password. by taking those inputs it should cross check with NTSystem userid and password .
    if i am trying for SampleLoginmodule it is asking for username and password and validating with the username and password working fine.
    Can any one please ....
    warm regards,
    bill

    hi,
    can any one pls.....
    warm regards,
    bill

  • How to implement SEARCH HELP for input field in WDA

    Hi All,
    I am doing a tool for my team. in this tool there are 4 input fields to show different processes. I implemented the 4 input fields and also bind the respective tables to these fields successfully. Actually I want to filter the data between 2 fields . Means the data in the 2nd input field should be based on the 1st input field. Means when I'll select for example 'CHI' (code for CHINA) in the 1st input field the 2nd field meant for country name should show all country name with value 'CHINA'. But the problem is that all values related to each field are in different table with no foreign key relationship and also some combinations are in single table..
    I have tried the import and export parameter method for search help but no luck till now.
    Can anyone please suggest me how to implement this scenario..
    Thanks in advance...
    sekhar

    Hi sekhar,
    Your Requirement can be implemented by OVS(Object Value selector) This is the custom search help .So that you can define on what basis the value has to be fetched.
    Look at the below link
    http://wiki.sdn.sap.com/wiki/display/WDABAP/ABAPWDObjectValueSelector(OVS)
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/606288d6-04c6-2c10-b5ae-a240304c88ea?quicklink=index&overridelayout=true
    You need to use the component WDR_OVS.
    It has 3 phases
    In phase 1
         You will fetch the value from input field to F4 help dialog box.
    In phase 2
         You will generate the search results , in this phase look for the input value given in field 2 and accordingly generate search result for the field 3.
    In phase 3
         The selected value will be returned to the original screen.
    Regards
    Karthiheyan M

  • How to implement JAAS With Weblogic 10.3

    I am working on a migration project. A project is to be migrated from JBOSS to Weblogic 10.3. JAAS has been used in JBOSS for security purpose.
    Required classess like LoginModule, CallBackHandler are customized and put into a jar file. Next a Login page has been created with action=”j_security_check”, which is supposed to be called whenever protected resource has been requested. In web.xml Roles and Policies are defined. There is a jboss-web.xml in which roles are mentioned. In web.xml
    There is a login-config.xml that has been put into Jboss server classpath. In this file, some sql queries are there.
    In weblogic I am not able to understand that how to configure this login-config, how to map roles and policies. Exactly I am not able to find what are the steps needed to implement this JAAS in weblogic10.3. I also tried using the Read-Only SQL Authenticator Provider under security Realms but not sure how to use groups, because I have no Group related tables in my DB.
    Kindly anyone share the knowledge.

    Hi,
    I also want to do the same thing. Did you get any solution for this problem. If yes then please share it with me. I am struggling with this.
    Thanks,
    Sanjay

  • How to implement Value Help for Product ID?

    Hi,
    I have a Z-Component where I want to use the value help of the Product ID. I found several components which use this value help for Products but I can't get it to work in my component properly.
    Does anybody have a short tutorial how I need to proceed?
    Thanks in advance.

    There is a search component that can be used for this purpose.
    This is one function out of several. I don't have the complete implementation at hand but this will give you the first idea.
    CALL METHOD cl_crm_uiu_prod_tools_search=>eh_onclosepopup_return_product     
       EXPORTING       
          ir_search_popup = search_popup     
       CHANGING       
          cr_context_node = lv_target_node       
          cv_index        = gv_tableindex. 

  • How to implement JAAS authorization with the weblogic 8.1 server

    i wrote a code for both the authentication as well as authorization using jaas using the config file and the policy file.
    This code works fine stand alone for the authentication as well as authorization.
    But when i runs this code inside the server (Weblogic 8.1), authorization deos not works according to my policy file. i have given the policy file path in the startWeblogicServer.cmd script. even i have tried to work with my policies in the java.policy file by giving its path in the java.security file. but this is also useless.
    Now, i have doubt that either <b>jaas authorization doesn't work with the weblogic</b>(i am using 8.1) or there is some configuration setting is missing from my side.
    Is there anybody who can help me to come out of this problem. Or tell me authorization alternative in the weblogic. I will really appreciate if anyone can help with the some example code.

    read this
    http://www.onjava.com/pub/a/onjava/excerpt/weblogic_chap17/index.html
    http://www.onjava.com/pub/a/onjava/excerpt/weblogic_chap17/index1.html

  • Implementing F4 Help

    Hi All,
    I need to implement a functionality similar to F4 help in ABAP screens. Is it possible to implement such functionality in a web dynpro java application?
    If it is possible then can you please provide some information on that?
    Regards,
    Bhargav

    Hi,
    Its very easy in webdynpro
    Please check
    1.[F4 Help|Re: F4 Help;
    2.[OVS in Webdynpro for Java|OVS in Webdynpro for Java;
    3.[F4 Search Help |Re: !!HELP!! F4 Search Help using SAP Web Dynpro;
    Best Regards
    Satish Kumar

  • Image Adjustments doesn't implement changes - help.

    Hope someone can help me with this:
    I am using Photoshop 11.0.1. I have two copies, one for myself and one for student workers in my office. For some reason, when we try to make an image adjustment -- such as changing levels or contrast -- we can see the preview of the change, but then when we click OK to implement the change, it jumps back to its original state and doesn't make the change.
    Any ideas why? This is driving me kind of nuts.

    I would try resetting the preferences by keyboard method or the manual way. I didn't see the operating system listed so you will have to scroll down to find the operating system if you do the manual way. Link:
    http://kb2.adobe.com/cps/405/kb405012.html
    Edit. windows 7 pref location is same as Vista.

  • Implementing F4 Help functionality of ABAP work bench on Adobe form

    Hi ,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/42/c8a3ccc84e136ee10000000a1553f7/frameset.htm
    Above link gives following description about Web Dynpro Form – UI Element ValueHelpDropDownList
    <b>ValueHelpDropDownList contains the script that is required for the link to the server in order to retain the elements of the list field from the back end at runtime. This Library object enables the end user to set up an input help request to the SAP server.  This request always works in online mode, but not in offline mode. A server-side update of the input help is possible.</b>
    Please explain me how ValueHelpDropDownList  UI Element works .
    Please correct my understanding -
    We use a RFC adaptive model BAPI to retrive data from R/3 system and bind the variable to ValueHelpDropDownList  UI Element . This means we get the data from backend in intialization of PDF form ( It means it is one time activity which will be used to extract data from R/3 system to display to end user ).
    Is there any alternative by which we can get data from R/3 system ( some thing similar to F4 help in ABAP work bench ).
    Please let me know if any one implemented this functionality .
    Regards,
    Nanda

    Hi Ankit,
    Thanks for a reply. Could you please explain the details? I am mapping a context attribute to the whole column and the value help button besides the field.
    Thanks
    Samatha.

  • Failure in implementing search help

    Dear forumers,
    I'm trying to implement a search help function in my selection screen but it's not working (for program name, TADIR-OBJ_NAME).
    What could possibly be wrong and how can I fix the problem (kindly refer to the codes below - I_TADIR is always empty without any records, so it is impossible to have data for search help)?
    Please help.
    REPORT  ydt_abap.
    TABLES: tadir.
    TYPES: BEGIN OF t_tadir,
             obj_name  TYPE tadir-obj_name,
           END OF t_tadir.
    CONSTANTS: c_program(4) TYPE c VALUE 'PROG'.
    DATA: i_tadir     TYPE STANDARD TABLE OF t_tadir.
    DATA: i_f4_result TYPE STANDARD TABLE OF ddshretval.
    DATA: w_f4_result TYPE ddshretval.
    PARAMETERS: p_dclass TYPE tadir-devclass.
    PARAMETERS: p_author TYPE tadir-author.
    PARAMETERS: p_prog   TYPE tadir-obj_name OBLIGATORY.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_prog.
      CLEAR: i_tadir,
             i_f4_result,
             w_f4_result.
    " Retrieve program names
      SELECT obj_name
        FROM tadir
        INTO TABLE i_tadir
        WHERE object   = c_program
          AND author   = p_author    " Debug mode: P_AUTHOR is always empty eventho a valid value has been entered
          AND devclass = p_dclass.   " Debug mode: P_DCLASS is always empty eventho a valid value has been entered
      IF i_tadir IS NOT INITIAL.     " Debug mode: I_TADIR is always empty here
    " Customize search help
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
          EXPORTING
            retfield        = 'P_PROG'
            value_org       = 'S'
          TABLES
            value_tab       = i_tadir
            return_tab      = i_f4_result
          EXCEPTIONS
            parameter_error = 1
            no_values_found = 2
            OTHERS          = 3.
    " Check return code
        IF sy-subrc EQ 0.
          READ TABLE i_f4_result INTO w_f4_result INDEX 1.
          IF sy-subrc EQ 0.
            p_prog = w_f4_result-fieldval.
          ENDIF.
        ELSE.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.
    START-OF-SELECTION.

    Hi,
    insert this:
      DATA: BEGIN OF DYNPFIELDS OCCURS 0.
              INCLUDE STRUCTURE DYNPREAD.
      DATA: END   OF DYNPFIELDS.
      DYNPFIELDS-FIELDNAME = 'P_AUTHOR'. APPEND DYNPFIELDS.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          DYNAME               = SY-REPID
          DYNUMB               = SY-DYNNR
        TABLES
          DYNPFIELDS           = DYNPFIELDS
        EXCEPTIONS
          INVALID_ABAPWORKAREA = 1
          INVALID_DYNPROFIELD  = 2
          INVALID_DYNPRONAME   = 3
          INVALID_DYNPRONUMMER = 4
          INVALID_REQUEST      = 5
          NO_FIELDDESCRIPTION  = 6
          INVALID_PARAMETER    = 7
          UNDEFIND_ERROR       = 8
          DOUBLE_CONVERSION    = 9
          STEPL_NOT_FOUND      = 10
          OTHERS               = 11.
      IF SY-SUBRC = 0.
        READ TABLE DYNPFIELDS WITH KEY FIELDNAME = 'P_AUTHOR'.
        P_AUTHOR = DYNPFIELDS-FIELDVALUE.
      ELSE.
        EXIT.
      ENDIF.
    befor   SELECT obj_name
    Regards, Dieter

Maybe you are looking for

  • Web Pages Need Renaming On Server to Work

    I've recently been creating web pages with Lightroom. I load them to our server, all the needed elements are uploaded properly it seems. however, when I try to access the web page it tells me the page can not be found. Here's the strange part. I go o

  • HOW TO CONNECT WITHOUT WIFI

    HOW DO CONNECT MY APPLE TV TO MY MODERN AS I HAVE ADSL CONNECTION AND NOT WIFI, IS THERE A CERTAIN CABLE I HAVE TO BUY OR GET MADE PLEASE HELP ASAP AS VERY KEEN TO WATCH MY TV SERIES ON A LARGER SCREEN INSTEAD OF MY MAC.

  • Moving average price/standard price via iDoc

    Hi, I would like to distribute moving average price and standard price on price change (price changed via transaction event or MR21) to external system. Is there a way to accomplish iDoc (MATMAS) triggering on price change? Any idea on how to track c

  • Looking for D7000 and Tokina 11-16mm Lens Profile

    I would think by now someone would have posted this lens profile but I can't find it for the life of me, sorry. I am sure this has been discussed to death but I have downloaded the lens profile creator (haven't figured out how to use it yet) and the

  • Problem Installing ACR 5.7 Update

    I have all programs closed when I try to install the Camera Raw 5.7 Update so I can edit photos in Photoshop CS4 from Lightroom 2.7.  Every time I try to install, an "Installation Incomplete" window pops up saying "Please close the following applicat