Spring Security is well-known for being highly customizable, so for my first attempt at working with Google App Engine, I decided to create a simple application which would explore the use of GAE features by implementing some core Spring Security interfaces. In this article we'll see how to:
- Authenticate using Google Accounts.
- Implement "on-demand" authentication when a user accesses a secured resource.
- Supplement the information from Google Accounts with application-specific roles.
- Store user account data in an App Engine datastore using the native API.
- Setup access-control restrictions based on the roles assigned to users.
- Disable the accounts of specific users to prevent access.
You should already be familiar with deploying applications to GAE. It doesn't take long to get a basic application up and running and you'll find lots of guidance on this on the GAE website.
Sample Application
The application is very simple and is built using Spring MVC. There is a welcome page deployed at the application root, and you can progress to a "home page", but only after authenticating and registering with the application. You can try out a version deployed in GAE
here.
The registered users are stored as GAE datastore entities. On first authenticating, new users are redirected to a…