Java: Sample Active Directory authentication code

Here is a sample Java code to authenticate against Windows Active Directory server.

  • The code finds all available active directory servers in your network.
  • It uses one of the available active directory server for authentication.
  • If an active directory server is down then it starts using next available server if any.
  • This class is thread-safe, you can create one instance and re-use them multiple times.
  • I tested this code from Linux and Windows box.

You can find the below source code in GitHub as well.
ActiveDirectoryAuthentication.java
Read more of this post

Advertisements

JavaEE – Clustering support in JSF, Wicket, ZK, etc.

When a seasoned MVC framework developer starts writing code in component based framework like JSF, Wicket, ZK, etc. they fail to understand the basic differences between MVC and component based framework because they could write code which can work in non-clustered environment i.e. in single JVM deployment. When the same application is deployed in a clustered environment they start realizing the difference which will require lots of effort revisit all the code and make it compatible for clustering. I am going to talk about a few guidelines on making development (on top of component based framework ) cluster aware.
Read more of this post

There is no language yet available to replace Java!

There is a perception created in the software development industry that Java is out-dated and Ruby, Python, Scala, etc. are going to take over Java’s position. Some “hyper-enthusiasts” are already left Java platform. Sun’s profit model collapse, Applet, Jini, EJB and JSF heavyweight framework failures added fuel to these campaigns. I still believe no language yet available in the market to replace Java. I don’t have to talk why Java is better because it is proven solution for more than a decade but I would like to talk about how false campaigns are created by “hyper-enthusiasts”. It is easy to fall into these false campaigns because as a developer we want new challenges and something new to learn. Read more of this post

Wicket in OC4J / OracleAS

Recently I tried deploying wicket framework based web application in OC4J container it didn’t work, whereas the same code works well in Tomcat. While googling found a few solution which recommends to use wicket servlet configuration instead of servlet filter to resolve the issue. I did the same but no luck. Then I tried associating a bookmarkable page for the homepage then it works well. Here is the code snippet: Read more of this post

Single-Sign-On (SSO) in Java Platform using Active Directory

Sorry guys it been long time writing in my blog.

Nowadays single-sign-on became a hot selling feature for all desktop and web-based products. In this article I talk about single-sign-on implementation in Java platform with Active Directory server. Since Microsoft Windows has become one of the most common corporate network platforms it is worth integrating with your product. Starting from Windows 2000 Microsoft supports Kerberos protocol. It is unusal that Microsoft support open-standard protocol, but they do in this case; good for us :-) Read more of this post

A JSP code to debug class loader issues

Class Loader is one of the complex concept/design to understand in Java programming. On the initial days working with Tomcat and Desktop application there is not much class loading issues. From EJB days class loading became complex by specification and implementation. Seems JavaEE 5 tries to simplify the class loading specification but I don’t know much about that. Read more of this post

Connection Pool vs. Thread Pool Settings

Connection Pool and Thread Pool are used to improve performance of applications. Most of us use these poolings with default settings not caring about their configurations or finding optimal values. But the configuration also an important factor in performance tuning. In some sense the connection pool and the thread pool settings are dependent. We will discuss about the dependency in this post. Read more of this post