This project demonstrates the following
- Dropwizard - Serves HTML
- OpenId - Provides integration with OpenId providers (Google, Facebook etc)
- Authorization - Security annotation supporting different levels of access
- Session cookies - Not very stateless, but this is only a demo - you'd use a database in real life
<project root> - The root directory of the project as checked out through git
All commands will work on *nix without modification, use \ instead of / for Windows.
From the console you can do the following
cd <project root>
mvn clean install
java -jar target/openid-demo-develop-SNAPSHOT.jar server openId-demo.yml
If you are behind a firewall you will need to set the proxy. This is configured in PublicOpenIDResource.
Here is an example of the authorization annotation as used in PrivateInfoResource.
/**
* @return The private home view if authenticated
*/
@GET
@Path("/home")
@Timed
@CacheControl(noCache = true)
public PublicFreemarkerView viewHome(
@RestrictedTo(Authority.ROLE_PUBLIC)
User publicUser) {
BaseModel model = newBaseModel();
return new PublicFreemarkerView<BaseModel>("private/home.ftl", model);
}The ASCII art for the startup banner was created using the online tool available at Webestools with a font of Tiza