How to connect to LDAP?

Hi,
where may I find information/documentatio/toturials of how to connect to LDAP from java classes?
Please help.
Thankyou,
Nadir.

Nadir,
Here:
http://java.sun.com/products/jndi/docs.html
You can find many things there and the tutorial is good.
Follow the links in http://java.sun.com/products/jndi/index.html#DOWNLOAD12, you can get many useful examples (great!).
Some code work fine in my app:
import javax.naming.*;
import javax.naming.directory.*;
env = new Hashtable(5, 0.75f);
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, URL);
env.put(Context.REFERRAL, "ignore");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, DN); //use your own one
env.put(Context.SECURITY_CREDENTIALS, PassWord); //use your own one
try {
ctx = new InitialDirContext(env);
} catch (NamingException e) {
e.printStackTrace();
Hope this helps.
Cheers,
George

Similar Messages

  • How we connect OPEN LDAP to weblogic server

    Hi All,
    How we connect OPEN LDAP to weblogic server

    There are several blogs for how you set up Open LDAP as a security provider:
    http://biemond.blogspot.com/2008/10/using-openldap-as-security-provider-in.html
    http://blogs.oracle.com/jamesbayer/2007/08/using_openldap_with_weblogic_s.html

  • How Java connect to LDAP?

    Hi guys
    Does anybody know how Java connect to LDAP server. Thanks in advance.
    Regards,
    Mark.

    http://www.java-pro.com/code/2000/JP0012.zip is the source code for the December 2000 issue of Java Pro magazine, which had an article about this. Inside you will find JP0012JB.zip which is the source code for working with LDAP. You don't get a copy of the articles in this zip file, only the code.

  • How to Connect to LDAP through SOA is it possible using BPEL

    Hi Guys,
    I have a requirement that how to access to LDAP system using BPEL process.
    do we need to write any java code to perform a few operations in to LDAP.
    Can you please tell me any one across this sceneario.
    Thanks in advance.
    Your help is more appreciate. this is urgent for us.
    Thanks.
    Chandrasekhar

    Hi Chandrasekhar
    1. Yes, there are many ways you can integrate AD with BPEL kind of indirectly. See some of the posts given below.
    oracle soa and active directory integration
    Weblogic administrator account is inactive after enabling DB Authenticator
    Also, once AD is integrated with Weblogic, using Admin Console etc, you can use the out of box REST services for quick testing. You can pretty much get and read all the stuff for any user/role/group/mappings etc. But its just ReadOnly and you cannot modify data on LDAP side. The below link should work for any security provider configured with your weblogic like DefaultAuthenticator or External AD integrated.
    http://soaserverhost:soaserverport/integration/services/IdentityService/identity
    Thanks
    Ravi Jegga

  • How to connect a LDAP Server?

    When creating the LDAP Data Server in Topology Manager using the Sunopsis LDAP Open Connector, the following message is displayed:
    "A NamingException occured saying: [LDAP: error code 49 - Invalid Credentials]"
    I use the sunopsis JDBC driver:
    com.sunopsis.ldap.jdbc.driver.SnpsLdapDriver
    and set the parameters:
    jdbc:snps:ldap?ldap_url=ldap://10.182.255.38:389/&ldap_basedn=cn=Users,dc=cn,dc=oracle,dc=com
    the user is set to:
    cn=orcladmin,cn=Users,dc=cn,dc=oracle,dc=com OR cn=orcladmin OR orcladmin, the error is the same.
    Could anyone tell me how to solve this issue?

    I can't connect to the ldap server.
    Using a simple java program, no problem, ODI, no go.
    Some code I found on the internet to connect to the ldap server
    Note the comments on SECURITY_PRINCIPAL and SECURITY_CREDENTIALS.
    This works fine for me.
    If I try to do the same with ODI, it doesn't work.
    Why?
    Kinde regards,
    Frans.
    public static void main( String[] args ) {
    // set up environment to access the server
    Properties env = new Properties();
    env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
    env.put( Context.PROVIDER_URL, "ldap://" + ldapServerName + "/" + rootContext);
    //env.put( Context.SECURITY_PRINCIPAL, rootdn );
    //env.put( Context.SECURITY_CREDENTIALS, rootpass );
    try {
    // obtain initial directory context using the environment
    DirContext ctx = new InitialDirContext( env );
    // now, create the root context, which is just a subcontext
    // of this initial directory context.
    //ctx.createSubcontext( rootContext );
    Attributes attr = ctx.getAttributes("");
    NamingEnumeration allAttr = attr.getAll();
    while (allAttr.hasMore()) {
    Attribute a = (Attribute)allAttr.next();
    System.out.println("attr: " + a.getID());
    NamingEnumeration values = attr.getAll();
    while (values.hasMore()) {
    System.out.println("value: " + values.next());
    catch ( NameAlreadyBoundException nabe ) {
    System.err.println( rootContext + " has already been bound!" );
    catch ( Exception e ) {
    System.err.println( e );
    }

  • How to connect from XI to LDAP

    Hi
    How to integrate XI and LDAP server.I know there is no LDAP adapter is available in XI. Can i use java proxy to connect to LDAP or is ther any other way to do the integration
    Regards
    Ravi Shankar B

    Hi
    You use a java proxy for doing XI <-> LDAP
    Helpful blogs.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7d4db211-0d01-0010-1e8e-9b07fc2113ab
    There is some config within XI (3.0 - SP5 onwards).
    Run transaction spro > Sap web Application Server > System Administration > Directory Integration > configure LDAP Connector, Define LDAP Users Confgure LDAP Server.
    Probably this could help you.
    Thanks
    Swarup

  • How to killl the idle or stale connection to LDAP

    I have client which is connecting to ldap server through iDAR. If the client doen't UNBIND usually, how can I make sure the idle connection could be closed, instead of climbing up?
    Thanks!

    Hi Rogers,
    Thanks for your message!
    Yes, you are right. iDAR does have the same attribute of nsslapd-masdescriptor. We already set it to 1024. In the mean time, we have set rlim_fd_max and rlim_fd_cur set in your /etc/system file. Both are set to 4096. After the change, we reboot our unix box.
    Based on documents I have read, it should function well. However, I don't know why it doesn't help me.
    Regarding the idle timeout issue, I guess I can create a speicific group in iDAR and set the idle timeout attribute for the new group. In that way, all the connection from certain IP will time out if they have timeout over the limit.
    So, in your understanding, the file descriptor should work for me. I believe you are right.
    What I should do next is testing. I will post my result when my connection issue is solved completely.
    Thanks!

  • How to connect LDAP though SSL

    Hi,
    I had successfully configured iDS4.1 to be a Naming Information Server,
    and I applied a Test cert to it which generated from Verisign. Now I
    would like to let all LDAP client connect to my LDAP server though the
    encrytion port 636, what should i do?
    Thanks
    Matthew

    Matthew Cheung wrote:
    >
    I had successfully configured iDS4.1 to be a Naming Information Server,
    and I applied a Test cert to it which generated from Verisign. Now I
    would like to let all LDAP client connect to my LDAP server though the
    encrytion port 636, what should i do?
    When you want to connect to LDAP via SSL the server sends his
    certificate to the client. The client then wants to verify this cert and
    therefore he needs the certificate of the issuer of the server cert. If
    the verification fails (e.g the issuer cert is missing, no longer valid,
    revoked or not trusted) the client refuses the connection to the server.
    So all your clients need the certificate of the issuer of your Test
    cert. In your case insert the Verisign certificate into your LDAP
    Clients as a trusted CA certificate. Then configure your clients to use
    a secure connection with host = your.ldap.host and port = 636 (or
    whatever port you use for encrypted connections). You also need the
    baseDN and maybe a bindDN and password.
    Armin Wenz

  • How to resolve "Connection to LDAP server failed." error?

    Hello,
    I have installed Coldfusion8 on one of my server that was having ColdFusionMX earlier.
    The ColdFusionMX admin settings are automatically transferred to the new Coldfusion8 admin page after installation.
    Also I have configured all my websites at the time of installation.
    After all when I am trying to login into one of my website system is throwing the below error.
    "Connection to LDAP server failed."
    Prevously it was working well with coldfusionMX. After installed Coldfusion8 I am facing this problem.
    Is there anything to do more with cf admin settings page or is this problem is with the code? (Infact I havent modified my cfm code)
    Please find the piece of code that I am using.
    <cfldap action="QUERY" server="#application.LDAPServer#" port="#application.LDAPPort#" start="#application.LDAPBase#" name="search" attributes="alias, dn, uid, technicalCareerLevel, locationorgunit, givenName, sn" filter="#filter#" scope="SUBTREE" maxRows="2">
    Anybody can assist me on this?
    Thanks in advance.
    Manoz.

    I have fixed this problem successfully.
    The problem was with the referral attribute of the cfldap tag.
    After adding this (referral="yes") attribute to my code I am able to login into my website.
    <cfldap action="QUERY" server="#application.LDAPServer#" port="#application.LDAPPort#" start="#application.LDAPBase#" name="search" attributes="alias, dn, uid, technicalCareerLevel, locationorgunit, givenName, sn" filter="#filter#" scope="SUBTREE" maxRows="2" referral="yes">
    Any way thanks for your assistance!!!!!

  • How to-Connect to Openfiler NAS ?

    How to-Connect to Openfiler NAS (Network Attached Storage)?
    I have enabled SMB/CIFS, NFSv3 and WebDAV.
    Current Share is Open250 (/mnt/open250/)
    I can connect through my web browser as the admin. Just need help connecting through the Finder.
    I've tried to connect by:
    • browsing (Network in Finder)
    • Keying the IP in Connect ot Server (w and w/o smb://)

    The Openfiler setup requires another computer to host the user account data (ldap). I wanted a simple solution for a home network. I now went to FreeNAS and this has worked beautifully.
    Now just waiting for iTV to be released then I'm good to go.

  • How to connect to MS Exchange Server?

    Does anyone know how to connect to a local MS Exchange Server? I know the server name and the directory hierarchy path name for the server. How do I connect?

    What is the purpose of connecting? If you just want to send/receive mail I think your question is already answered. If you want to interact with the server, say to read/write tasks, calendar, etc., well that too can be done but it gets pretty hairy.
    If you have the money, a product call "Harmony for Exchange" by compoze is probably your quickest/easiet option (http://www.compoze.com/hcs_exchange.html). It provides a Java API into the Exchange Collaboration Data Objects -- all for a mere $8k per CPU.
    Another option is J-Integra's Exchange bridge (http://www.intrinsyc.com/products/bridging/jintegra.asp), it is actually the foundation of Compoze's product. The J-Integra bridge ($3k per server) exposes proxy classes into the raw CDO. No problem if you have lots of CDO programming experience, not much fun for a novice.
    I've heard that you can even use LDAP to interact with the server, but I don't have any experience with that. Anybody know of other options? I'm still struggling with these alternatives myself.

  • Console cannot connect to ldap after SSL config

    Hi,
    I configured our iplanet DS 5.0 to use SSL (requested cert from DS, signed and created a new cert with openSSL, verified that DS could read that cert, and turned on ssl). Restarted DS and admin-serv. The ldap is working but ldaps is not. The console is unable to connect to DS and just hangs when trying to connect. The console is configured to connect to ldap not ldaps, but when I view the configuration for DS in console it shows port 636. So -
    - how do I make the console use port 389 to connect to the DS?
    - What do I need to do to get ldaps working?
    TIA.
    Raj Dolas

    There are some limitations in using the Console when SSL is enabled for the Directory Server. These are documented... in the release notes at least.
    Regards,
    Ludovic.

  • How can i enable ldap service in my system?

    How can i enable ldap service in my system?while running my prgram i am getting an error connection refused why?

    hi
    thanks for u r kind attention.
    i want execute simple jndi program on WinXPwhich uses ldap sevices.
    in the JNDI Tutorial it is given that u can make use of ldap service provided by JDK.i am using a latest version of jdk.
    where the programs for enabling ldap sevice is located in JDk ?how can i enable it?
    and also i have down latest releases of openLDAP software?if the earlier is not possible u tell me how to configure openLDAP?
    thanks in advance

  • Connectivity to Ldap

    Post Author: trueblueg8tor
    CA Forum: Data Connectivity and SQL
    Thanks for reading. I'm trying to write Crystal reports against ldap, more specifically, MS ADAM. Does anyone have any experience/ideas about how I can go about doing this?

    Hi,
    I am having the same question.
    I am using Crystal Reports 2008. From Designer, I want to establish a connection to LDAP (Microsoft Active Directory). Can anyone share info on how to accomplish this?
    Thank You!

  • How to connect OpenLDAP WAS Java, EP?

    Hello experts,
    did anyone succed to connect an OpenLDAP to WAS Java?
    I think a OpenLDAP libary need to be installed/configured in order to use it for the user management in the EP.
    I would appreciate to get information how to realize the connection?
    Where I can get the libary?
    Is there any step-by-step-guide?
    Thanks in advance.
    Thomas

    Thank you for your reply.
    I would like to connect an OpenLDAP to our EP7.0 with Web Application Server Java.
    However all experts just inform me that it is possible to use LDAP as a datasource. I know this already and I know where to find general information about using LDAP for identity management.
    But I need information how to connect especially an OpenLDAP to EP7.0 with WAS Java, Win2k3 64bit; Connection should be writeable and in a Flathierachy.
    I think I just have to adjust one of the LDAP-configuration XML-files to the OpenLDAP requirements.
    In the standard delivery there are already Configuration-XML-Files for Microsoft AD, Novell, Sun etc.
    Is there already an Configuration-XML-File which I can use for OpenLDAP?
    If not how I can use and adjust the exisiting files to make the OpenLDAP connection work (Access writeable, Flathierachy)?
    Thanks in advance for your help.
    Thomas

Maybe you are looking for

  • How to read CURSOR contents

    Hi Experts, I want to read the contents thats being fetched in %DBCURSOR in DEBUG mode. Is it possible to do that?? If yes, how? Also, how can i ensure whether any data is fetched by the SELECT query into          %DBCURSOR. Following is the piece of

  • How to remove iCloud on iPad2, iOS 8, No Password, User left Company?

    How do I remove iCloud on iPad2, iOS 8? I don't have the password because the user left our company. No password means I can't turn off "Find My iPad". I do have a company AppleID if that is needed.

  • Windows closes program - get runtime error R6025 c:\virtual pure virtual funcition call

    when trying to get into ITUNES i get a runtime error R6025 C:\prgoram files (X86) \:itunes.exe c:\virtual pure virtual funcion call microsoft visal c++ runtime library OS windows 7  64 bit it was working 2 weeks ago

  • BIPublisher 11g Pdf template

    Hi Experts, I am trying to build pdf template in 11.1.1.5 BIP.Please can you let me know which version of latest acrobat reader or any other tool used to write xml code on template. Thanks Shyam

  • Call component controller method from view

    Hi I have created an action in view Thus its event handler is "OnActionDoSomething()" And, I have a method in component controller "MethodSaySomething()". Now, how can I call MethodSaySomething() from OnActionDoSomething(). OnActionDoSomething() // C