Securing your Flex app: smart card authentication with Spring Security (Part 2)

In this article I am going to show you how to implement Smart Card authentication mechanism in a Flex application with Spring Security. I will use X.509 certificate authentication and database authorization simultaneously. To get a full picture of the topic, you should take a look at my previous article Securing your Flex application with Spring Security and Active Directory.
The application used in this article is based on the previous sample project available for download here (current version included). You could install it and as you read, make appropriate modifications described below. Last time we integrated our Flex application with Microsoft Active Directory LDAP server by using the authentication and authorization mechanism offered by the Spring Security. Spring Security framework is an excellent tool for implementing security requirement for enterprise applications as it offers comprehensive security services for J2EE-based enterprise applications. These services are simple enough to implement even for those, who have little background in Java.
Now, I will show you how easily the login mechanism can be changed and how to mix different scenarios together. Once a user is authenticated with the smart card, the next step is to load roles from a sql server database. If the client does not have valid certificate, database authentication mechanism can be used.
Read more »
Securing your Flex application with Spring Security and Active Directory
![]() Download Sample |
See also my follow up article: Securing your Flex app: smart card authentication with Spring Security
The goal of the current article is to provide a clear overview how to integrate a Flex application with Active Directory using the authentication and authorization mechanism offered by the new Spring Security.
Before downloading the sample project, you should have: Java web app server (I'm using Apache Tomcat) and Active Directory with login credentials. Instead of AD you can use any LDAP directory server (for example ApacheDS).
To run the sample Flex project you don't need download extra .jar or .swc libraries or create a Java project with an IDE. Just unzip the sample project into your Tomcat webapps directory and change LDAP server settings. However, to recompile the Flex project you should download the Flex source project with Granite DS library granite.swc, add it to the Flex Build Path and to define Flex Server. The directory structure for the project looks like.
For those who don't know: Spring is an lightweight Java framework. Spring Portfolio includes now the Spring Security 2.0. providing comprehensive security services for J2EE-based enterprise applications. Spring Security 2 builds upon the popular Acegi Security, but it is much easier to use than former Acegi Security. Rod Jonson, creator of the Spring framework, noticed recently that one of the problems with Acegi Security was that it was very powerful but it wasn't simple to use.
Using the GraniteDS and Cairngorm together
I have been using the Cairngorm framework in my application from the day I started to develop it. It has helped me a lot in understanding the Flex as it is somewhat different that is done in Java. At some point I wanted to start using the GraniteDS because of Spring but at the same time I didn't want to give up Cairngorm. Read more »
