Package org.kuali.rice.kim.api.identity.entity

Examples of org.kuali.rice.kim.api.identity.entity.EntityContract


   
    if (email == null) {
      log.error("Email attribute was not found in attributes");
      return "Email address was not found in response " + MartinlawConstants.OPENID_ERROR_MSG_INDICATOR;
    } else {
      EntityContract entity = getEntityInfoService().getEntityByEmail(email);
     
      if (entity == null) {
        return "Email address '" + email + "' is not associated with an existing user"
             + MartinlawConstants.OPENID_ERROR_MSG_INDICATOR;
      } else if (!hasEmploymentAffiliation(entity)) {
        return "You are not affiliated as a staff :(";
      } else if (!entity.isActive()) {
        return "Your account is not active :(";
      } else {
        if (emailSetupOk()) {
          String fromAddr = getParameterService().getParameterValueAsString(
              KewApiConstants.KEW_NAMESPACE, "Mailer", KewApiConstants.EMAIL_REMINDER_FROM_ADDRESS);
          createAndEmailActivation(email, token.getIdentityUrl(), entity, fromAddr);
          return entity.getDefaultName().getFirstName() +
            ", an activation email has been sent to '" + email + "' from address '" + fromAddr 
            + "'. If none comes to your inbox or spam folder after a few minutes, please contact support";
        } else {
          return "An activation email could not be sent to '" + email +
              "' due to a missing email configuration" + MartinlawConstants.OPENID_ERROR_MSG_INDICATOR;
View Full Code Here


  /**
   * Test method for {@link org.martinlaw.auth.OpenIDSuccessAuthenticationSuccessHandler#EntityInfoService#getByEmail(String)}
   */
  public void testGetByEmail() {
    OpenIDSuccessAuthenticationSuccessHandler successHandler = new OpenIDSuccessAuthenticationSuccessHandler();
    EntityContract entity = successHandler.getEntityInfoService().getEntityByEmail("clerk1@localhost");
    assertNotNull("entity should not be null", entity);
    assertEquals("principal name differs", "clerk1", entity.getPrincipals().get(0).getPrincipalName());
    entity = successHandler.getEntityInfoService().getEntityByEmail("clerk21@localhost");
    assertEquals("entity should be null", null, entity);
  }
View Full Code Here

TOP

Related Classes of org.kuali.rice.kim.api.identity.entity.EntityContract

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.