Retrieve parameters from LDAP using authentication module

I have existing LDAP that contains organization people and their attributes. I have several web applications that use existing LDAP for authentication and authorization. My goal is to deploy single sign-on with openSSO so that users are authenticated against existing LDAP. Changing of the existing LDAP is forbidden.
I deployed newest stable OpenSSO and Apache2 + newest policy agents to web service servers.
OpenSSO server uses LDAP authentication module to authenticate users against existing LDAP. It uses flat file data repository and realm attributes -> user profile is ignored.
This basic setup works fine. The next step is to integrate existing web applications to single sign-on system. The authentication part works fine. I just disabled old mechanism from web applications that did the LDAP authentication. OpenSSO and Apache Policy agent are handling that part.
The existing web applications are still querying existing LDAP other attributes there than uid and userpassword. Is it possible to configure OpenSSO to forward LDAP attributes to web application as cookie or header value? Or is the forwarding feature only for attributes in Data Store?
If the forwarding is not possible what is the next best alternative ?

OpenSSO forum is quite silent so I'm back with you guys.
I managed to solve the agent error log problem I mentioned before. The problem was about nonexisting attributes in AMAgent.properties com.sun.am.policy.agents.config.profile.attribute.map. I removed extra attributes and the authentication against LDAP started to work again.
The problem is that no attributes are forwarded from LDAP to web application. I have tried HTTP_COOKIE and HTTP_HEADER settings in AMAgent.properties and com.sun.am.policy.agents.config.profile.attribute.map is set to cn|common-name,mail|email.
My LDAP looks like this:
# testuser, pollo.fi
dn: cn=testuser,dc=pollo,dc=fi
cn: testuser
objectClass: organizationalPerson
objectClass: inetOrgPerson
givenName: Test
sn: User
ou: People
uid: testuser
mail: [email protected]
And my datastore configuration:
LDAP server->localhost:389
LDAP bind DN->cn=admin,dc=pollo,dc=fi
LDAP organization DN->dc=pollo,dc=fi
Attribute name mapping->empty
LDAP3 Plugin supported types and operations->agent,group,realm,user all read,create,edit,delete
LDAP3 Plugin search scope->scope_sub
LDAP Users Search Attribute->uid
LDAP Users Search Filter->(objectclass=inetorgperson)
LDAP User Object Class->organizationalPerson
LDAP User Attributes->uid, userpassword
Create User Attribute Mapping->empty
Attribute Name of User Status->inetuserstatus
User Status Active Value->Active
User Status Inactive Value->inactive
LDAP Groups Search Attribute->cn
LDAP Groups Search Filter->(objectclass=groupOfUniqueNames)
LDAP Groups container Naming Attribute->ou
LDAP Groups Container Value->groups
LDAP Groups Object Class->top
LDAP Groups Attributes->cn,description,dn,objectclass
Attribute Name for Group Membership->empty
Attribute Name of Unqiue Member->uniqueMember
Attribute Name of Group Member URL->memberUrl
LDAP People Container Naming Attribute->ou
LDAP People Container Value->people
LDAP Agents Search Attribute->uid
LDAP Agents Container Naming Attribute->ou
LDAP Agents Container Value->agents
LDAP Agents Search Filter->(objectClass=sunIdentityServerDevice)
LDAP Agents Object Class->sunIdentityServerDevice,top
LDAP Agents Attributes->empty
Identity Types That Can Be Authenticated->Agent,User
Authentication Naming Attribute->uid
Persistent Search Base DN->dc=pollo,dc=fi
Persistent Search Filter->(objectclass=*)
Persistent Search Maximum Idle Time Before Restart->0
Should I enable some setting still to get the forwarding going on? Any ideas for debugging?

Similar Messages

  • Need help in retrieving attributes from LDAP using JNDI

    I am trying to retrieve attributes from LDAP using JNDI, but I'm getting the following error when I try to run my Java program.
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/naming/NamingException
    I have all the jar files in my classpath: j2ee.jar, fscontext.jar and providerutil.jar. The interesting thing is that it gets compiled just fine but gives an error at run-time.
    Could anyone tell me why I'm getting this error? Thanks!
    Here's my code:
    import javax.naming.*;
    import javax.naming.directory.*;
    import java.util.*;
    import java.io.*;
    class Getattr {
    public static void main(String[] args) {     
    // Identify service provider to use     
    Hashtable env = new Hashtable(11);     
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");      
    // user     info
    String userName = "username";     
    String password = "password";          
    // LDAP server specific information     
    String host = "ldaphostname";     
    String port = "portnumber";     
    String basedn = "o=organization,c=country";     
    String userdn = "cn=" + userName + "," + basedn;          
    env.put(Context.PROVIDER_URL, "ldap://" + host + ":" + port + "/" + basedn);     
    env.put(Context.SECURITY_PRINCIPAL, userdn);     
    env.put(Context.SECURITY_CREDENTIALS, password);     
    try {          
    System.setErr(new PrintStream(new FileOutputStream(new File("data.txt"))));     
    // Create the initial directory context     
    DirContext ctx = new InitialDirContext(env);          
    // Ask for all attributes of the object      
    Attributes attrs = ctx.getAttributes("cn=" + userName);          
    NamingEnumeration ne = attrs.getAll();                    
    while(ne.hasMore()){                         
    Attribute attr = (Attribute) ne.next();                                   
    if(attr.size() > 1){               
    for(Enumeration e = attr.getAll(); e.hasMoreElements() ;) {                                       
    System.err.println(attr.getID() + ": " + e.nextElement());                     
    } else {
         System.err.println(attr.getID() + ": " + attr.get());
    // Close the context when we're done     
    ctx.close();     
    } catch(javax.naming.NamingException ne) {
         System.err.println("Naming Exception: " + ne);     
    } catch(IOException ioe) {
         System.err.println("IO Exception: " + ioe);     

    That doesn't work either. It seems its not finding the NamingException class in any of the jar files. I don't know why? Any clues?

  • How to retrieve data from MDM using java API

    hi experts
    Please explain me the step by step procedure
    how to retrieve data from MDM using java API
    and please tell me what are the
    important classes and packages in MDM Java API
    thanks
    ramu

    Hi Ramchandra,
    You can refer to following links
    MDM Java API-pdf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2d18d355-0601-0010-fdbb-d8b143420f49
    webinr of java API
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/89243c32-0601-0010-559d-80d5b0884d67
    Following Fourm Threads will also help.
    Java API
    Java API
    Re: usage of  java API ,
    Matching Record
    Need Java API for Matching Record
    Thanks and Regards,
    Shruti.
    Edited by: Shruti Shah on Jul 16, 2008 12:35 PM

  • Unable to retrieve parameters from RFC Function Module

    Hi All,
    I have created a model for the RFC Enabled function module BAPI_BUPA_CENTRAL_GETDETAIL within my webdynpro program. I am passing parameters to the function module BAPI_BUPA_CENTRAL_GETDETAIL and I have validated that this is being passed correctly by displaying the passed value from the node of the input parameters.
    Code used to pass input parameters -
      IWDMessageManager manager = wdComponentAPI.getMessageManager();
       try
          wdContext.currentBapi_Bupa_Central_Getdetail_InputElement().modelObject().execute();
          size = wdContext.nodeCentraldataperson().size();     
          wdComponentAPI.getMessageManager().reportSuccess(Integer.toString(size));
          wdContext.nodeOutput().invalidate();
       catch(WDDynamicRFCExecuteException e)
          manager.reportException(e.getMessage(), false);
    I also see that it returns 1 record by using the code below:
    IWDMessageManager manager = wdComponentAPI.getMessageManager();
       try
          wdContext.currentBapi_Bupa_Central_Getdetail_InputElement().modelObject().execute();
          size = wdContext.nodeCentraldataperson().size();     
          wdComponentAPI.getMessageManager().reportSuccess(Integer.toString(size));
          wdContext.nodeOutput().invalidate();
       catch(WDDynamicRFCExecuteException e)
          manager.reportException(e.getMessage(), false);
    But, when I try to retrieve the value returned it does not fetch that value -
       Bapi_Bupa_Central_Getdetail_Output getdata = wdContext.nodeBapi_Bupa_Central_Getdetail_Input().nodeOutput().currentOutputElement().modelObject();
       Bapibus1006_Central_Person[] getres = new Bapibus1006_Central_Person[size];
       for(int i=0; i<size; i++){
            wdComponentAPI.getMessageManager().reportSuccess(Integer.toString(i));
            getres<i> = getdata.getCentraldataperson();
              //String fullname = wdContext.nodeBapi_Bupa_Central_Getdetail_Input().nodeOutput().nodeCentraldataperson().getElementAt(i).getAttributeValue("Fullname").toString();
            String fullname = getres<i>.getFullname();
           fullname += Integer.toString(i);
            wdContext.currentContextElement().setFullname(fullname);
            wdComponentAPI.getMessageManager().reportSuccess("fullname:" + fullname);
    It always returns 0 or null. Can someone please help me with this issue. The BAPI returns values in structure format and not internal table and hence I dont see the issue there as well.
    What can be the problem?
    Thanks for all your help in advance.
    Best regards,
    Divya

    Nikhil / Srihari,
    I changed my code and it now looks like -  I am trying get the return value into the context fullname but i still cant get the value although the size of nodeCentraldataperson() is thrown as 1 and the input is being passed correctly as i have validated this in this line of code [wdContext.nodeBapi_Bupa_Central_Getdetail_Input().currentBapi_Bupa_Central_Getdetail_InputElement().getBusinesspartner();]
    IWDMessageManager manager = wdComponentAPI.getMessageManager();
       try
          wdContext.currentBapi_Bupa_Central_Getdetail_InputElement().modelObject().execute();
          size = wdContext.nodeCentraldataperson().size();     
          wdComponentAPI.getMessageManager().reportSuccess(Integer.toString(size));
          wdContext.nodeCentraldataperson().invalidate();
       catch(WDDynamicRFCExecuteException e)
          manager.reportException(e.getMessage(), false);
         for(int i=0; i <size; i++){
              String name = "FullName: ";
              wdContext.nodeBapi_Bupa_Central_Getdetail_Input().nodeOutput().nodeCentraldataperson().setLeadSelection(i);
              name += wdContext.nodeBapi_Bupa_Central_Getdetail_Input().currentBapi_Bupa_Central_Getdetail_InputElement().getBusinesspartner();
              name += wdContext.nodeBapi_Bupa_Central_Getdetail_Input().nodeOutput().nodeCentraldataperson().currentCentraldatapersonElement().getFullname();
              wdContext.currentContextElement().setFullname(name);     
    Any idea what could be wrong?
    Thanks,
    Divya

  • Retrieving user and group information from LDAP using j_securrity_check

    Hi
    I am using j_security_check to authenticate users against LDAP. I have made all necessary configuration for the server to perform LDAP group search as well as mentioned in the WAS documentation of LDAP settings. Now, how can I retrieve the user and the user group info after the j_secuirty_check. Apart from the UserPrincipal object which I can get from the request which just has the user name, is there any other object which will give me the user and user group info by which I need to connect to LDAP using my java code to retrieve these informations?
    Regards
    Deepak

    Hi
    I am using j_security_check to authenticate users
    against LDAP. I have made all necessary configuration
    for the server to perform LDAP group search as well
    as mentioned in the WAS documentation of LDAP
    settings. Now, how can I retrieve the user and the
    user group info after the j_secuirty_check.
    Apart
    from the UserPrincipal object which I can get from
    the request which just has the user name, is there
    any other object which will give me the user and user
    group info by which I need to connect to LDAP using
    my java code to retrieve these informations?Hmm, you don't need the user group info to connect to the LDAP server, right? You would need the user's Id (which you have) and password (which you don't). You could use the LDAP credentials and bind as that to look up the user info via the user id. Or if the server is set up to allow anonymous bind you could do it without credentials. But if all you want is group info then you should be able to call Security.getCurrentSubject().getPrincipals() to get the user principal as well as all groups (this is true in BEA WebLogic at least).
    Good Luck
    Lee

  • How i get user info from ldap using java after authenticating user with SSO

    Hi
    I have one jsp/bean application as a partner application with SSO.
    It works fine.
    Now i need to get other attributes of user from LDAP who has logged into the application through SSO.
    using SSO java APIs i only get username, userDN, subscriber info.
    To get user's other attribute i have to user LDAP APIs for that i have to create on Directory Context, for the same i need userpassword.
    so here i my question, how do i get user password after he has logged in thro SSO.
    regards..
    and thanking u in advance
    samir

    Valentina,
    there's no way to get the password value from the directory (it's one way). Of course you can get the hashed (MD4,MD5,SHA-1) base64 encoded value (i.e. the value you see in OiD) but not the 'password'.
    --Olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • SAP Module sapnwrfc: Retrieving data from SAP using RFC

    I'm sorry, if I'm asking about something that's obvious in SAP. I need to develop a perl application in a remote server that will receive a requisition from an abap application.
    I'm using the SAP Module sapnwrfc. I connect to SAP Gateway with no errors and execute the function sapnwrfc::installFunction (no errors returned) but I can't find the transaction in SAP. Anybody has some document about configurations that I need to do in sap ? Or anybody could see the code above and tell me what is wrong?
    [code]
    #!/usr/bin/perl
    use sapnwrfc;
    use Data::Dumper;
    use utf8;
      SAPNW::Rfc->load_config;
      my $conn = SAPNW::Rfc->rfc_connect;
      # print "Testing SAPNW::Rfc-$SAPNW::Rfc::VERSION\n";
      my $func = new SAPNW::RFC::FunctionDescriptor("ZRFCDAZEL") ;
      my $pipedata = new SAPNW::RFC::Type(name => 'DATA',
                                          type => RFCTYPE_TABLE,
                                          fields => [{name => 'OBJTY',
                                                      type => RFCTYPE_CHAR,
                                                      len => 4},
                                                     {name => 'OBJKY',
                                                      type => RFCTYPE_CHAR,
                                                      len => 10},
                                                     {name => 'ATTRIBUTES',
                                                      type => RFCTYPE_CHAR,
                                                      len => 255},
      $func->addParameter(new SAPNW::RFC::Export(name => "COMMAND",
                                                 len => 255,
                                                 type => $pipedata));
      $func->addParameter(new SAPNW::RFC::Import(name => "COMMAND1",
                                                 len => 255,
                                                 type => $pipedata));
    $funcao->callback(\&do_remote_pipe);
    $conn->disconnect();
    exit;
    sub do_remote_pipe {
        my $param = shift;
        print "\nPARM : " . $param->{'ZDUS'} . "\n";
        $param->COMMAND1([{'LOG'=>'Execute ZDUS PARAMETER '}]);
        $param->COMMAND1([{'STATUS'=>'S'}]);
        return 1;
    sub do_global_callback {
        warn "Running global callback ...\n";
        return 1;

    Timo,
    I included the code in the VO and in my bean, I was able to generate this code snippet:
    public String GetParamterSetup() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("applyParamVOCriteria");
            operationBinding.getParamsMap().put("vcodetype", codeType);
            Object result = operationBinding.execute();
            System.out.println(result);
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
    I was able to get the result from the System.out.println. It returns null when there is no match. However, I  want  to return the entire row or have access to that attribute.  For instance if I have 'GB011' what the system will display for me is 'viewrow [oracle.jbo.Key[GB011 ]]'
    Pls, how can I have access to individual attributes like ParamSetup.codeType, ParamSetuo.MainCode etc...

  • Getting parameters from URL: use of Special Chars

    I'm unable to retrieve the Special Chars from URL parameters.  Does someone have an idea where to look for?
    Examples where no Special Chars is retrieved :
    ...App?param=Aménagement
    ...App?param=Am<é>nagement
    ...App?param=Am%E9nagement
    I'm using this code :
              IWDProtocolAdapter protocolAdapter =
                   WDProtocolAdapter.getProtocolAdapter();
              IWDRequest request = protocolAdapter.getRequestObject();
                                    String param = request.getParameter("param");
    Thanks!

    okay, So if I use :
    ...App?param=Am%E9+nagement
    How would you then integrate URLDecoder.decode in the following code?
    IWDProtocolAdapter protocolAdapter =
         WDProtocolAdapter.getProtocolAdapter();
    IWDRequest request = protocolAdapter.getRequestObject();
    String param = request.getParameter("param");

  • How to retrieve information from XML using servlets

    Hi
    I have a scenario like this
    File-->XI-->J2ee application(HTTP Receiver adapter)
    I want to know how XI sends xml file as a query string file name?
    What ever may be the case i just need to retrieve the information from Request object and display the same in browser(JSP).How to do that, I am totally confused, please anyone help me!
    Code help is highly rewarded.
    Thanx

    Hi Rajesh!
    I have tried your code. But some where i went wrong. Please correct me: I am using NWDS2.0.9
    my web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
                             "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
        <display-name>WEB APP</display-name>
        <description>WEB APP description</description>
        <servlet>
            <servlet-name>DisplayRes</servlet-name>
            <servlet-class>com.quinnox.DisplayRes</servlet-class>
        </servlet>
        <servlet-mapping>
              <servlet-name>DisplayRes</servlet-name>
              <url-pattern>/DisplayRes/*</url-pattern>
         </servlet-mapping>
    </web-app>
    my application.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
                                 "http://java.sun.com/dtd/application_1_3.dtd">
    <application>
        <display-name>ReceiverEntpr</display-name>
        <description>EAR description</description>
        <module>
            <web>
                <web-uri>HttpReceiver.war</web-uri>
                <context-root>/HttpReceiver</context-root>
            </web>
        </module>
    </application>
    and my servlet code:
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintWriter;
    import java.io.Writer;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.InputSource;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Result;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.xml.sax.EntityResolver;
    import org.xml.sax.SAXException;
    import com.sun.java_cup.internal.parser;
    import com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl;
    public class DisplayRes extends HttpServlet {
         public void doGet(HttpServletRequest requset, HttpServletResponse response) throws ServletException, IOException
              doWork(requset, response);
         public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
              doWork(req, resp);
         private void doWork(HttpServletRequest req, HttpServletResponse resp) throws IOException
              String path = null;
              PrintWriter out = null;
              PrintWriter p2=resp.getWriter();     
              try
                   resp.setContentType("text/xml");
                   out = resp.getWriter();
                   out.println("hi");
                   path = req.getPathInfo();
                   if(req.getContentLength() != -1){
                   outputURI(req.getInputStream(), out);
              } catch (IOException ioe) {     return;     
         //private void outputURI(InputStream resultStream, Writer out) {
              private void outputURI(InputStream resultStream, PrintWriter out) {
              if (resultStream == null) {
    //             no default file
    //            logger.error("No File to return");
              return;
              try {
              DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    //            Class clazz = loader.loadClass("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
    //            DocumentBuilderFactoryImpl factory = (DocumentBuilderFactoryImpl) clazz.newInstance();
    //            DocumentBuilder parser = factory.newDocumentBuilder();
              parser.setEntityResolver(new ClassPathEntityResolver());
              printXML(parser.parse(resultStream), out);
              resultStream.close();
              } catch (Exception e) {
    //            logger.error("Trying to parse the output " , e);
         //private void printXML(Document document, Writer writer) throws Exception {
              private void printXML(Document document, PrintWriter writer) throws Exception {
              Transformer transformer = TransformerFactory.newInstance().newTransformer();
              Source source = new DOMSource(document);
              Result output = new StreamResult(System.out);
              transformer.transform(source, output);
    //             Write as XML so that entity references can be resolved.
              if (writer != null) {
              transformer.transform(source, new StreamResult(writer));
    Please tell me how to display in servlet.
    If it is better to display in a browser. Please send me the code.
    Thanks

  • Unable to Retrieve Attributes from LDAP Server

    I have a problem. I was wondering if anyone can assist me. I am new to LDAP servers and JNDI. I cannot retrieve any attributes from the users listed in my data entry. Any assistance would be greatly appreciated! Thanks.
    I created an entry in the LDAP server that looks like this:
    �o=somedn�
    |
    �ou=people, o=somedn�
    The �ou=people, o=somedn� entry contains fictitious users. The LDAP server is connected to a MySQL database. When I write Java code to read the attributes of a given user whose fullname (cn) is �Vinny Luigi�, as listed in the database, I receive an error that starts with the following:
    javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'cn=Vinny Luigi,ou=people'
    The code I used is based on the Sun JNDI tutorial. Sun�s code is at http://java.sun.com/products/jndi/tutorial/basics/directory/src/GetattrsAll.java. My version of the code is below:
    * @(#)GetattrsAll.java     1.5 00/04/28
    * Copyright 1997, 1998, 1999 Sun Microsystems, Inc. All Rights
    * Reserved.
    * Sun grants you ("Licensee") a non-exclusive, royalty free,
    * license to use, modify and redistribute this software in source and
    * binary code form, provided that i) this copyright notice and license
    * appear on all copies of the software; and ii) Licensee does not
    * utilize the software in a manner which is disparaging to Sun.
    * This software is provided "AS IS," without a warranty of any
    * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
    * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
    * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE
    * HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE
    * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
    * MODIFYING OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN
    * NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
    * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
    * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
    * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT
    * OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS
    * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
    * This software is not designed or intended for use in on-line
    * control of aircraft, air traffic, aircraft navigation or aircraft
    * communications; or in the design, construction, operation or
    * maintenance of any nuclear facility. Licensee represents and warrants
    * that it will not use or redistribute the Software for such purposes.
    import javax.naming.*;
    import javax.naming.directory.*;
    import java.util.Hashtable;
    * Demonstrates how to retrieve all attributes of a named object.
    * usage: java GetattrsAll
    class GetattrsAll
         static void printAttrs(Attributes attrs)
              if (attrs == null)
                   System.out.println("No attributes");
              else
                   /* Print each attribute */
                   try
                        for (NamingEnumeration ae = attrs.getAll(); ae.hasMore();)
                             Attribute attr = (Attribute) ae.next();
                             System.out.println("attribute: " + attr.getID());
                             /* print each value */
                             for (NamingEnumeration e = attr.getAll(); e.hasMore(); System.out.println("value: " + e.next()) )
                   } catch (NamingException e) {
                        e.printStackTrace();
         public static void main(String[] args) {
              // Set up the environment for creating the initial context
              Hashtable env = new Hashtable(100);
              env.put(Context.INITIAL_CONTEXT_FACTORY,
                        "com.sun.jndi.ldap.LdapCtxFactory");
              env.put(Context.PROVIDER_URL, "ldap://localhost:10389/o=somedn");
              try {
                   // Create the initial context
                   DirContext ctx = new InitialDirContext(env);
                   // Get all the attributes of named object
                   System.out.println("About to use ctx.getAttributes()");
                   Attributes answer = ctx.getAttributes("cn=Vinny Luigi,ou=people");
                   // Print the answer
                   printAttrs(answer);
                   // Close the context when we're done
                   ctx.close();
              } catch (Exception e) {
                   e.printStackTrace();
    The primary key of the database is id_pk. Below is a copy of the mapping.xml file which maps the LDAP server entry to the database:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE mapping PUBLIC "-//Penrose/DTD Mapping 1.2//EN" "http://penrose.safehaus.org/dtd/mapping.dtd">
    <mapping>
    <entry dn="o=somedn">
    <oc>organization</oc>
    <oc>top</oc>
    <at name="o" rdn="true">
    <constant>somedn</constant>
    </at>
    <aci>
    <permission>rs</permission>
    </aci>
    </entry>
    <entry dn="ou=people,o=somedn">
    <oc>inetOrgPerson</oc>
    <oc>organizationalPerson</oc>
    <oc>organizationalUnit</oc>
    <oc>person</oc>
    <oc>top</oc>
    <at name="cn">
    <constant>"fullname"</constant>
    </at>
    <at name="ou" rdn="true">
    <constant>people</constant>
    </at>
    <at name="sn">
    <constant>"lastname"</constant>
    </at>
    </entry>
    <entry dn="id_pk=...,ou=people,o=somedn">
    <oc>inetOrgPerson</oc>
    <oc>organizationalPerson</oc>
    <oc>person</oc>
    <oc>top</oc>
    <at name="Position_">
    <variable>usertable9.Position_</variable>
    </at>
    <at name="id_pk" rdn="true">
    <variable>usertable9.id_pk</variable>
    </at>
    <at name="fullname">
    <variable>usertable9.fullname</variable>
    </at>
    <at name="lastname">
    <variable>usertable9.lastname</variable>
    </at>
    <at name="cn">
    <variable>usertable9.fullname</variable>
    </at>
    <at name="sn">
    <variable>usertable9.lastname</variable>
    </at>
    <source name="usertable9">
    <source-name>usertable9</source-name>
    <field name="Position_">
    <variable>Position_</variable>
    </field>
    <field name="id_pk">
    <variable>id_pk</variable>
    </field>
    <field name="fullname">
    <variable>cn</variable>
    </field>
    <field name="lastname">
    <variable>sn</variable>
    </field>
    </source>
    </entry>
    </mapping>
    Thanks.

    The complete name (Distinguished Name) of the user you're searching is 'cn=Vinny Luigi,ou=people,o=somedn'.
    Regards,
    Ludovic.

  • Error while Retrieving users from DB using Field Loop

    Hi,
    Im working on IDM 6.0 in Sun Appserver 8.1, with waveset on SQL Server2000.
    I have a rule that list all the users from a table in SQL Server2000.
    Ive used this rule in a form to get list of all users. This rule works fine in BPE and the drivers are properly placed
    When I view the Form I get the following error.
    XPRESS exception ==> com.waveset.util.WavesetException: Can't call method queryList on class com.waveset.util.JdbcUtil ==> com.waveset.util.WavesetException: ==> java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Could not find server 'com' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.

    I was able to solve the error but how can I display the all fields retrieved by the query. (like select name,comments from tablename)
    This is my code. I just need to display comments
    <FieldLoop for='cdata1'>
      <expression>
        <rule name='MSSQL DB Connect'/>       <!-- This rule lists all users.-->
      </expression>
      <Field name='accounts[$(cdata1)].name'>
        <Display class='Text'>
          <Property name='size'>
            <Integer>10</Integer>
          </Property>
          <Property name='value'>
            <ref>cdata1</ref>               <!-- prints user -->
          </Property>
        </Display>
      </Field>
      <Field name='accounts[$(cdata1)].comments'>  
        <Display class='TextArea'>
          <Property name='rows'>
            <Integer>1</Integer>
          </Property>
          <Property name='columns'>
            <Integer>15</Integer>
          </Property>
        </Display>
      </Field>
    </FieldLoop>Thanx

  • Error while retrieving data from sql using jdbc adapter

    hi all,
    i m working on one scenario where i m sending data using HTTP and receiver is jdbc adapter which is retrieving me data from sql server.
    i have checked the structure both for req and res.
    i m getting this error
    <SAP:Error>
    <SAP:Category>Application</SAP:Category>
    <SAP:Code>MAPPING.EXCEPTION_DURING_EXECUTE</SAP:Code>
    <SAP:P1>com/sap/xi/tf/_INF57285_DB_HR_RES_</SAP:P1>
    <SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
    <SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3>
    <SAP:Stack>During the application mapping com/sap/xi/tf/_INF57285_DB_HR_RES_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio~</SAP:Stack>
    </SAP:Error>
    can somebody help me with this.
    Thanks & Regards
    Aruna

    thnks bhavesh i think i made it that way
    JDBC REQ  
      <ns:INF57285_DB_Request xmlns:ns="http://www.infosys.com/xi/training/hyd/57285">
      <Employee>
        <EmpDetails action="SELECT">
          <table>EmpDetails</table>
          <access>
            <Name />
            <EmpId />
            <Band />
            <Salary />
          </access>
          <Key>
            <EmpId>57285</EmpId>
          </Key>
        </EmpDetails>
      </Employee>
    </ns:INF57285_DB_Request>                        
      JDBC RES
    <ns:INF57285_DB_Request_response xmlns:ns="http://www.infosys.com/xi/training/hyd/57285">
      <Employee_response>
        <row>
          <Name>aruna</Name>
          <EmpId>57285</EmpId>
          <Band>A</Band>
          <Salary>4675776</Salary>
        </row>
      </Employee_response>
    </ns:INF57285_DB_Request_response>
    my hr req is which i mapped with DB req
    <ns:INF57285_HR_Req xmlns:ns="http://www.infosys.com/xi/training/hyd/57285">
      <REQUEST>
        <EmpNo>57285</EmpNo>
      </REQUEST>
    </ns:INF57285_HR_Req>
    my hr res is which i mapped with DB res
    <ns:INF57285_HR_Res xmlns:ns="http://www.infosys.com/xi/training/hyd/57285">
      <response>
        <row>
          <Name>aruna</Name>
          <Empld>57285</Empld>
          <Salary>4675776</Salary>
        </row>
      </response>
    </ns:INF57285_HR_Res>
    and interestingly i am not getting any error in sxmb_moni
    it's not showing any error
    plz suggest me something wht to do ....
    thnks & regards
    Aruna

  • How to get structure from Idoc using function module?

    Hi all,
    I am looking for a function module in order to get the structure of a message type used for iDoc. The aim is to get the data element from the different fields in order to check authority if the data element is BUKRS.
    Thanks for your help!
    David

    Hi David,
    You can use the FM "IDOC_TYPE_COMPLETE_READ" which will get you the complete details of the IDOC type along with data elements referred for each fields in the segments.
    The aim is to get the data element from the different fields in order to check authority if the data element is BUKRS.
    Not sure if i understood the above requirement, if you could provide more info on the requirement, i guess you might get better a better solution from the forum. As there are other data elements with different names for company code (just look up *BUKRS* in SE11 under Data Elements to see what i mean), not sure if you can cover it all.
    Regards,
    Chen

  • Fetching from LDAP using JDNI with WebObjetcs,/ EOF, failing.

    Hello.
    I have been working on a WebObjects app that connects to a LDAP server, I create the EOModel (reverse engineered) from EOModeler in eclipse, but I cant set up relationships because in the LDAP server there are no such attributes that references the parents and sons. . i.e I have
    -XWS (root)
         -Contacts (objClass=XWSContactsGroup)
              -Apple.(objClass=XWSContactsGroup)
                   -Gustavo Pizano
              -XWS(objClass=XWSContactsGroup)
                   -Veronica Pizano
                   -Carolina Pizano
              -PhotoCenter(objClass=XWSContactsGroup)
                   -Gilbert Pizano
    And I want to get all the Contacts from a certain group (right now due the inability to do it via relationships, Im doing qualifiers) .. but Im getting weird results...
    I can get an NSArray from the XWS group which has 2 elements. but those 2 elements are the same. :S
    Any help I will appreciate it.
    Thanks
    Gustavo

    Dude wrote:
    You don't need the extra exit. Not using an explicit exit command ran into an old SQL*Plus bug with v7 and prior - where eof was ignored and input read until an explicit exit was encountered.
    Despite this bug not being there in the SQL*Plus 7.1 version I was using, I was made very aware by my senior Oracle colleagues that it was non-negotiable and that an exit statement was expected in all the SQL*Plus scripts I wrote.
    A practise I still follow and encourage today. Relying on implicit behaviour is not a characteristic of robust code. Explicitly defining behaviour is. Rather code an exit statement than ignoring it and trusting the s/w to understand your intent and behave accordingly.

  • How to retrieve email from iCloud using GMail?

    I currently have a Dot Mac email account that I have retrieved from MobileMe by my GMail account. If I move my Dot Mac address to iCloud, what settings will need to be changed in my GMail account?

    Does iCloud still use the mail.me.com server or is it now mail.icloud.com?
    I've gone to www.icloud.com using Safari on my iPad  and my iPhone, but then I hit a wall because I'm not ready to transfer my mac.com & me.com email addresses over to iCloud yet. I paid $99 for MobileMe and I can't see throwing that away this early.
    Hopefully there will be a "Take Control of iCloud" released in the next few months. Also, since Apple is now investigating ways to allow merging of Apple IDs, I'd like to wait until they announce what they determine will be required.
    As for using a desktop computer to access iCloud webmail, I'll have to find the cheapest used Mac that can run Lion and then just use it for those rare times I absolutely have to access it that way. Most of the time that Mac will be completely off and disconnected. I absolutely abhor Lion; it is the worst version since Cheetah.

Maybe you are looking for

  • IPod will not update properly - What is going on?!

    I've just got a new computer and I accidentally managed to delete all my music files. Since I couldn't retrieve them, I started putting my music onto this new computer.. the iTunes on it was working fine. But when I came to update the songs onto my i

  • Why won't LP digital booklets open?

    hello, i can't seem to be able to open digital booklets when downloaded with the album. I've installed Adobe reader and Ibooks, tried to open the file from folder location, and even deleted the booklet and redownloaded. any advice please? cheers soni

  • Reload Software: 552 Error

    I got a blackberry tour for about 4 months now and absolutely love it... until it started getting this 552 error. Last time it happend, i was on a trip and i ended up not having a functional phone for an entire weekend since i had no access to a wind

  • [Resolved] WDK bug with url links

    Hello, My problem concerns the Wireless Developer Kit (10.1.2.0). First I will explain my context: I develop XHTML-MP jsp web pages with Jdeveloper in order to display them on Pocket PC or mobile phones. My problem is that when I want, for instance,

  • Adding a field to a form based on a table

    Hi I am unable to make the following scenario work. I have a form which is called from a report. The report passes in an ID parameter. This form field then displays the text associated with this ID because it has a LOV attached to it. However, the us