Security securityConfig = new Security();
securityConfig.setUseContextHandler(false);
DefaultPrincipal defaultPrincipal = new DefaultPrincipal();
defaultPrincipal.setRealmName("geronimo-properties-realm");
Principal principal = new Principal();
principal.setClassName("org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal");
principal.setPrincipalName("izumi");
defaultPrincipal.setPrincipal(principal);
securityConfig.setDefaultPrincipal(defaultPrincipal);
Role role = new Role();
role.setRoleName("content-administrator");
principal = new Principal();
principal.setClassName("org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal");
principal.setPrincipalName("it");
Realm realm = new Realm();
realm.setRealmName("geronimo-properties-realm");
realm.getPrincipals().add(principal);
role.getRealms().put(realm.getRealmName(), realm);