just added the following piece of code and it works:
Properties userGroups = new Properties();
userGroups.setProperty("john", "user");
UserGroupCallbackManager manager = UserGroupCallbackManager.getInstance();
manager.setCallback(new DefaultUserGroupCallbackImpl(userGroups));