Package com.esri.gpt.framework.security.principal

Examples of com.esri.gpt.framework.security.principal.User


   
    // ensure that the old password was supplied correctly for the user
    UsernamePasswordCredentials testCred = new UsernamePasswordCredentials();
    testCred.setUsername(origCred.getUsername());
    testCred.setPassword(origCred.getPassword());
    User testUser = new User();
    testUser.setCredentials(testCred);
    authenticate(testUser);
   
    // ensure that the new credentials are valid
    CredentialPolicy policy = new CredentialPolicy();
    policy.validatePasswordPolicy(newCred);
View Full Code Here


    DirContext dirContext = client.getConnectedContext();
    LdapQueryFunctions queryF = client.getQueryFunctions();
    StringSet ssDNs = queryF.readGroupMembers(dirContext,groupDN);
    for (String sDN: ssDNs) {
      String sName = queryF.readUsername(dirContext,sDN);
      User user = new User();
      user.setDistinguishedName(sDN);
      user.setKey(user.getDistinguishedName());
      user.setName(sName);
      users.add(user);
    }
  } finally {
    if (client != null) client.close();
  }
View Full Code Here

          }
        } else {
         
          // establish the user
          identity = "urn:openid:"+identity;
          User user = context.getUser();
          user.reset();
          user.setKey(identity);
          user.setDistinguishedName(identity);
          user.setName(username);
          user.getProfile().setUsername(username);
          if (email.length() > 0) {
            user.getProfile().setEmailAddress(email);
          }
          user.getAuthenticationStatus().setWasAuthenticated(true);
         
          // ensure a local reference for the user
          try {
            LocalDao localDao = new LocalDao(context);
            localDao.ensureReferenceToRemoteUser(user);
          } catch (Exception e) {
            user.reset();
            err = "Openid authentication suceeded, creating local user reference failed.";
            LOGGER.log(Level.SEVERE,err,e);
          }
        }
       
View Full Code Here

* @param activeUser the user associated with the active request
*/
public RoleMap(User activeUser) {
  _activeUser = activeUser;
  if (_activeUser == null) {
    _activeUser = new User();
  }
}
View Full Code Here

*/
@Override
public Users readGroupMembers(String groupDN)
  throws IdentityException, NamingException, SQLException {
  Users users = new Users();
  User user = new User();
  user.setDistinguishedName(getDN());
  user.setKey(user.getDistinguishedName());
  user.setName(getUsername());
  users.add(user);
  return users;
}
View Full Code Here

    user.setDistinguishedName(sAuthenticatedDN);
    populateUser(requestContext,user,sTargetedGroupDN);
   
    RoleSet roles = user.getAuthenticationStatus().getAuthenticatedRoles();
    if (roles.hasRole("gptForbiddenAccess")) {
      User activeUser = requestContext.getUser();
      if(activeUser.getAuthenticationStatus().getWasAuthenticated()){
        String activeUserDn = requestContext.getUser().getDistinguishedName();
        String managedUserDn = user.getDistinguishedName();
        if(activeUserDn.equals(managedUserDn)){
        throw new AuthenticationException("Forbidden");
        }
View Full Code Here

*/
public HrUpdateRequest(RequestContext requestContext,
                       User owner,
                       HrRecord record) {
  super(requestContext, new HrCriteria(), new HrResult());
  _owner = owner != null ? owner : new User();
  _repository = record != null ? record : new HrRecord();
}
View Full Code Here

* repositories is set to non existing user.
*
* @param owner owner of the repository
*/
public void setOwner(User owner) {
  _owner = owner != null ? owner : new User();
}
View Full Code Here

*/
protected User recoverUserPassword(DirContext dirContext,
                                   String username,
                                   String emailAddress)
  throws NamingException {
  User userFound = null;
  UsernamePasswordCredentials credentials = null;
  username = Val.chkStr(username);
  emailAddress = Val.chkStr(emailAddress);
  if ((username.length() > 0) && (emailAddress.length() > 0)) {
    LdapQueryFunctions queryFunctions = new LdapQueryFunctions(getConfiguration());
    LdapUserProperties userProps = getConfiguration().getUserProperties();
    boolean bMultipleFound = false;
    String sBaseDN = userProps.getUserSearchDIT();
    String sFilter = userProps.returnUserLoginSearchFilter(username);
    StringSet ssDNs = queryFunctions.searchDNs(dirContext,sBaseDN,sFilter);

    // loop through each DN found, check for an email address match
    for (String sDN: ssDNs) {
      User userTmp = new User();
      userTmp.setDistinguishedName(sDN);
      queryFunctions.readUserProfile(dirContext,userTmp);
      if (userTmp.getProfile().getEmailAddress().equals(emailAddress)) {
        if (userFound == null) {
          credentials = new UsernamePasswordCredentials();
          credentials.setUsername(username);
          credentials.generatePassword();
          userFound = userTmp;
View Full Code Here

*/
protected void updateUserPassword(DirContext dirContext,
                                  User user,
                                  UsernamePasswordCredentials newCredentials)
  throws NamingException {
  User userUpd = new User();
  userUpd.setDistinguishedName(user.getDistinguishedName());
  String sPassword = newCredentials.encryptLdapPassword(
         getConfiguration().getUserProperties().getPasswordEncryptionAlgorithm());
  userUpd.getProfile().set(UserAttributeMap.TAG_USER_PASSWORD,sPassword);
  updateUserProfile(dirContext,userUpd,false,true);
}
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.security.principal.User

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.