Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!

Swosti Dipan Pal

Ranch Hand
+ Follow
since Sep 23, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Swosti Dipan Pal

The searchFilter and searchCtls are n't properly provided.

Try this in your first code in this post.

//specify the LDAP search filter
String searchFilter = "(&(objectClass=*))";

//Specify the Base for the search
String searchBase = "O=Microsoft,C=COM";

SearchControls searchCtls = new SearchControls();

//federationBoundary ,objectClass ,sn - These are the fields which are available in LDAP. You can provide your own fields.

String returnedAtts[] = { "federationBoundary", "objectClass","sn" };

searchCtls.setReturningAttributes(returnedAtts);

searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);

NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
12 years ago
Try giving base,o=Microsoft only.
12 years ago
The following base doesn't exist in the LDAP. Send me the tree hierarchy. I can help you out.

CN=Mary Baker,OU=ADAM users,O=Microsoft,C=COM
12 years ago
[ UD: Please don't post questions into unrelated topics. That's called "hijacking", and considered not a nice thing to do. Start a new topic instead. ]
[ April 01, 2008: Message edited by: Ulf Dittmer ]
12 years ago
Could anyone tell me the steps for the eDirectoy/LDAP SSL implementation ? I am facing the issue.
12 years ago
If you haven't installed eclipse then, you can follow the following approach.

1. Go to the directory where you have installed you JBoss.
2.Then go to \server\default\deploy and put your WAR there.

If this doesn't work, then please provide your working environment details and I will be able to reply you accordingly.

Thanks
12 years ago
I am working on the SSL port for the eDirectory authentication. My non SSL port works fine. My SSL port is n't working when I set the client certificate = required.

I am creating the initial context factory and putting the environment variables to authenticate.

Please let me know any sample code or solution.


Thanks
12 years ago
Any idea how to display the content of the blob in a jsp. I don't know what is being stored in the blob ?
I have a column in MQSQL which holds blob data. This data is nothing but , the ActiveMQ queue. I don't know what is the format and what it contains. I want to show it in a jsp the value/content stored in it. Please help.
I found a solution to it. Thanks.
12 years ago
I am sorry. I should have giving the implementation pseuduo code earlier.

pseudo code:

//get the username and password

//check for the properties file for a specific key ( willAuth = Yes)- if Yes , data will be sent to server 1

if (found){
//Pass the credential to the server 1
if (Authenticated){
//set ldapAuth = true;
}
else{
//set mySqlAuth = flase;
}
}
...

if (mySqlAuth == false){
//send the credential to Server 2
//set mySqlAuth = true;
}

if ( ldapAuth = true || mySqlAuth = true){

// do this common task

}
12 years ago
No, the class is having only the user name and password. What I am trying to do is find out a specific key=value pair from a properties file. Depending on that it will choose the server.

Please let me know if you have any better idea.

Thanks a lot !
12 years ago
I am using the InitialDirContext.I am passing the hashtable values to this constructor. I am n't using any connection ? Is there any need of it ?

DirContext ctx = new InitialDirContext(env);

The error which I am getting is given below.

>>>>> javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
11:15:30,356 INFO [STDOUT] >>>>> simple bind failed: 208.53.52.78:6362
11:15:30,356 ERROR [STDERR] javax.naming.CommunicationException: simple bind failed: 208.53.52.78:6362 [Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]
11:15:30,357 ERROR [STDERR] at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:197)
11:15:30,358 ERROR [STDERR] at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2637)
11:15:30,358 ERROR [STDERR] at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:283)
11:15:30,358 ERROR [STDERR] at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
11:15:30,358 ERROR [STDERR] at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193)
11:15:30,358 ERROR [STDERR] at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:136)
11:15:30,358 ERROR [STDERR] at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66)
11:15:30,358 ERROR [STDERR] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
11:15:30,358 ERROR [STDERR] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
11:15:30,358 ERROR [STDERR] at javax.naming.InitialContext.init(InitialContext.java:223)
11:15:30,358 ERROR [STDERR] at javax.naming.InitialContext.<init>(InitialContext.java:197)
11:15:30,358 ERROR [STDERR] at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:82)
11:15:30,358 ERROR [STDERR] at com.dbridge.ldap.ldap.getAllPersonNames(ldap.java:69)
11:15:30,358 ERROR [STDERR] at org.apache.jsp.html.helloWorld_jsp._jspService(helloWorld_jsp.java:77)
11:15:30,358 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
11:15:30,358 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
11:15:30,358 ERROR [STDERR] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
11:15:30,359 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
11:15:30,359 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
11:15:30,359 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
11:15:30,359 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
11:15:30,359 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
11:15:30,359 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
11:15:30,359 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
11:15:30,359 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
11:15:30,359 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
11:15:30,359 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
11:15:30,359 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
11:15:30,359 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
11:15:30,359 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
11:15:30,359 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
11:15:30,359 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
11:15:30,359 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
11:15:30,359 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
11:15:30,359 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
11:15:30,359 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
11:15:30,360 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
11:15:30,360 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
11:15:30,360 ERROR [STDERR] Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
11:15:30,360 ERROR [STDERR] at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:150)
11:15:30,360 ERROR [STDERR] at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1584)
11:15:30,360 ERROR [STDERR] at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:174)
11:15:30,360 ERROR [STDERR] at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:168)
11:15:30,360 ERROR [STDERR] at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:848)
11:15:30,360 ERROR [STDERR] at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:106)
11:15:30,360 ERROR [STDERR] at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:495)
11:15:30,360 ERROR [STDERR] at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:433)
11:15:30,360 ERROR [STDERR] at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:877)
11:15:30,360 ERROR [STDERR] at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1089)
11:15:30,360 ERROR [STDERR] at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:737)
11:15:30,360 ERROR [STDERR] at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
11:15:30,360 ERROR [STDERR] at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
11:15:30,360 ERROR [STDERR] at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
11:15:30,360 ERROR [STDERR] at java.io.BufferedInputStream.read(BufferedInputStream.java:313)
11:15:30,361 ERROR [STDERR] at com.sun.jndi.ldap.Connection.run(Connection.java:784)
11:15:30,361 ERROR [STDERR] ... 1 more
11:15:30,361 ERROR [STDERR] Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
11:15:30,361 ERROR [STDERR] at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:221)
11:15:30,362 ERROR [STDERR] at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:145)
11:15:30,362 ERROR [STDERR] at sun.security.validator.Validator.validate(Validator.java:203)
11:15:30,362 ERROR [STDERR] at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:172)
11:15:30,362 ERROR [STDERR] at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(SSLContextImpl.java:320)
11:15:30,362 ERROR [STDERR] at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:841)
11:15:30,362 ERROR [STDERR] ... 12 more
11:15:30,362 ERROR [STDERR] Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
11:15:30,362 ERROR [STDERR] at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:236)
11:15:30,362 ERROR [STDERR] at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:194)
11:15:30,362 ERROR [STDERR] at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:216)
11:15:30,362 ERROR [STDERR] ... 17 more
12 years ago
Hi,

I have a JSP which reads the user name and password and redirects to class which authenticates the user. Here, the authentication will be done by one of the two different servers. The class needs to decide which server to call. Is there any good design to follow ?

Thanks in Advance.
12 years ago
I have used the following code to authenticate to the eDirectory server using the 389 port. However, when I am using the 636 (secured port) it is throwing error. Please help me to know the source of error and solution to this issue.


Hashtable env = new Hashtable();

env.put(Context.SECURITY_AUTHENTICATION, "simple");

env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
//env.put(Context.PROVIDER_URL,"ldap://208.53.52.78:389/dc=dblab,dc=lab";);
env.put(Context.PROVIDER_URL,
defaultProps.getProperty("PROVIDER_URL"));
/*env.put(Context.SECURITY_PRINCIPAL,
defaultProps.getProperty("SECURITY_PRINCIPAL"));
env.put(Context.SECURITY_CREDENTIALS, defaultProps.getProperty("SECURITY_CREDENTIALS"));*/
//String userName="CN="+logon+",CN=Users,DC=dblab,DC=lab";
String userName="CN="+logon+",o=SAMS";
env.put(Context.SECURITY_PRINCIPAL,userName);
env.put(Context.SECURITY_CREDENTIALS,pwd);
12 years ago