Package org.pac4j.gae.profile

Examples of org.pac4j.gae.profile.GaeUserServiceProfile


        kryo.register(GaeUserServiceProfile.class);
    }

    @Override
    protected void verifyProfile(final UserProfile userProfile) {
        final GaeUserServiceProfile profile = (GaeUserServiceProfile) userProfile;
        logger.debug("userProfile : {}", profile);
        final String id = "test@example.com";
        assertEquals(id, profile.getId());
        assertEquals(GaeUserServiceProfile.class.getSimpleName() + UserProfile.SEPARATOR
                + id, profile.getTypedId());
        assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), GaeUserServiceProfile.class));
        assertCommonProfile(userProfile, id, null, null, "test", null,
                Gender.UNSPECIFIED, null, null, null, null);
        assertEquals(2, profile.getAttributes().size());
    }
View Full Code Here


  @Override
  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;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.pac4j.gae.profile.GaeUserServiceProfile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.