Mind the Flex

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

March 26th, 2009 | Posted by sven-
Filed under Flex, Java, Spring | 5 Comments »

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

July 7th, 2008 | Posted by sven-
Filed under Flex, Java, Microsoft, Spring | 17 Comments »

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.

Read more »



Using the GraniteDS and Cairngorm together

April 13th, 2008 | Posted by Martin
Filed under Flex, Java, Spring | 2 Comments »

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 »



Java classes to Actionscript3 classes using Maven 2

April 2nd, 2008 | Posted by Martin
Filed under Flex, Java, Maven | 4 Comments »

At some point I found myself in a situation where I had data objects in Java and in order to use the same objects in Flex application I had to duplicate these classes in Actionscript 3. It was pretty boring and in addition to that, the possibility to forget to add or change some attribute was very high and it happened of course more than once. As I started to look around in web I had very low expectations to find a tool for converting Java classes to Actionscript classes. After some digging I found that actually there is a great tool, which does exactly what I needed. Read more »



Setting up a Java and Flex Project in Maven 2 for Beginners

March 31st, 2008 | Posted by Martin
Filed under Flex, Java, Maven | 18 Comments »

Maven is a tool that provides an uniform and easy build process for your projects. In real life this means generally that you describe your project in one xml file and Maven reads this information to compile and package your project. The pros of this approach are that the project can be set up quickly in new environment, you can quite transparently add new features, and you have all the time clear overview of libraries that are used in your project.
Read more »



Sun Certified Java Programmer Mock Exam in Flex

March 29th, 2008 | Posted by sven-
Filed under Flex, Java | 4 Comments »

You can jump directly into the Java mock exam demo here (written in Flex).

If you are ever planning to take the Sun Certified Programmer exam, you need at least four things: 1) the Java language specification; 2) a good study guide; 3) a exam simulator; 4) and free time for coding. The spec isn't an easy reading material, but with an "brain-friendly" study guide (by Sierra and Bates) they are essential to passing the SCJP exam.
Read more »



Setting up the environment for Flex and Java development with Maven 2

March 23rd, 2008 | Posted by Martin
Filed under Flex, Java, Maven | 5 Comments »

To start developing Flex you have two choices: to use FlexBuilder or Flex plugin for Eclipse. As we would like to develop Flex and Java parallely, the Flex plugin approach is the only reasonable way to continue. At first you must have Eclipse (~100MB) installed. It can be obtained from here (must be at least version 3.3 or higher) and it must of course have Java development support. The plugin itself (~300MB) can be downloaded from here but you must have an Adobe ID to download it.
Read more »



Experience of Developing Flex with Maven

March 21st, 2008 | Posted by Martin
Filed under Flex, Java | 3 Comments »

If you are building a small Flex application then the Maven is of course an absolute overkill but if you are working in a team and have to release the application that uses Java then Maven is worth considering. I myself started to use Maven in the Flex project because of Java. As it worked well I tried to move on and use it also with Flex. It took some time but in the end I was quite happy when I could just type in the command "mvn install" and the Maven took the Flex and Java source code, compiled it, packed into a war and deployed to my Tomcat server. The major reason why I initially started to use it was that I had to share the project source code and it would have taken a lot of time to setup the environment in the other computers. With Maven, I ended up having only one property file which had environment specific stuff in it and I could set up the project in Mac and Windows without problems.
Read more »