protected GaeUserServiceProfile retrieveUserProfile(GaeUserCredentials credentials, WebContext context) {
User user = credentials.getUser();
if (user != null) {
GaeUserServiceProfile gaeUserProfile = new GaeUserServiceProfile();
gaeUserProfile.setId(user.getEmail());
gaeUserProfile.addAttribute(GaeUserServiceAttributesDefinition.EMAIL, user.getEmail());
gaeUserProfile.addAttribute(GaeUserServiceAttributesDefinition.DISPLAYNAME, user.getNickname());
if (service.isUserAdmin()) {
gaeUserProfile.addRole(GaeUserServiceProfile.PAC4J_GAE_GLOBAL_ADMIN_ROLE);
}
return gaeUserProfile;