}
Constraint userConstraint = new Constraint();
userConstraint.setRoles(new String[] {"user"});
userConstraint.setAuthenticate(true);
ConstraintMapping restrictedConstraintMapping = new ConstraintMapping();
restrictedConstraintMapping.setConstraint(userConstraint);
restrictedConstraintMapping.setPathSpec("/*");
Constraint noAuthenticationConstraint = new Constraint();
noAuthenticationConstraint.setAuthenticate(false);
ConstraintMapping publicConstraintMapping = new ConstraintMapping();
publicConstraintMapping.setConstraint(noAuthenticationConstraint);
publicConstraintMapping.setPathSpec("/jax/bundles/fm/prototype/login.ftl");
JAASLoginService loginService = new JAASLoginService("OpenGamma");
loginService.setLoginModuleName("og");
server.addBean(loginService);