Package com.esri.gpt.framework.security.credentials

Examples of com.esri.gpt.framework.security.credentials.UsernameCredential


        DistinguishedNameCredential dnCredential;
        dnCredential = (DistinguishedNameCredential)credentials;
        sAuthenticatedDN = dnCredential.getDistinguishedName();
       
      } else if (credentials instanceof UsernameCredential) {
        UsernameCredential unCredential = (UsernameCredential)credentials;
        String sBaseDN = userProps.getUserSearchDIT();
        String sFilter = userProps.returnUserLoginSearchFilter(unCredential.getUsername());
        StringSet ssDNs = getQueryFunctions().searchDNs(
                          getConnectedContext(),sBaseDN,sFilter);
        if (ssDNs.size() > 1) {
          throw new IdentityException("Multiple LDAP usernames matched for:"+ unCredential.getUsername());
        } else if (ssDNs.size() == 1) {
          sAuthenticatedDN = ssDNs.iterator().next();
        }
      }
    }
View Full Code Here


    } else if (credentials instanceof DistinguishedNameCredential) {
      DistinguishedNameCredential dnCred = (DistinguishedNameCredential)credentials;
      bAuthenticated = (getDN().length() > 0) &&
                       dnCred.getDistinguishedName().equalsIgnoreCase(getDN());
    } else if (credentials instanceof UsernameCredential) {
      UsernameCredential unCred = (UsernameCredential)credentials;
      bAuthenticated = (getUsername().length() > 0) &&
                       unCred.getUsername().equalsIgnoreCase(getUsername());
    }
  }
 
  // setup the authenticated user
  if (bAuthenticated) {
View Full Code Here

 
  private String getUserEmail(String userName) throws SQLException, IdentityException, CredentialsDeniedException, NamingException {
    if (emailCache.containsKey(userName)) {
      return emailCache.get(userName);
    } else {
      UsernameCredential unCredential = new UsernameCredential(userName);
      User user = new User();
      user.setCredentials(unCredential);
      idAdapter.authenticate(user);
      idAdapter.readUserProfile(user);
View Full Code Here

      user.setDistinguishedName(userIdentifier);
      DistinguishedNameCredential dnCredential = new DistinguishedNameCredential();
      dnCredential.setDistinguishedName(userIdentifier);
      user.setCredentials(dnCredential);
    }else if(userIdentifier.length() > 0) {
      user.setCredentials(new UsernameCredential(userIdentifier));
    }
    ((LdapIdentityAdapter)idAdapter).populateUser(context, user);
    return user;
  }else{   
    throw new Exception("error")
View Full Code Here

                String samlUsername = ic.getUsernameFromSAMLToken(samlToken);
                RequestContext rc = context.getRequestContext();
                if ((rc != null) && (samlUsername != null)) {
                  User user = rc.getUser();
                  user.reset();
                  user.setCredentials(new UsernameCredential(samlUsername));
                  rc.newIdentityAdapter().authenticate(user);
                  context.getRequestOptions().getTransactionOptions().setPublicationMethod("seditor");

                  expr = "//tcExt:tcSecurity/tcExt:tcSecuredAction[tcExt:status='draft']";
                  Node ndTmp = (Node)xpath.evaluate(expr,ndSoapEnv,XPathConstants.NODE);
View Full Code Here

          setUser(new User());
          sn.setAttribute(USERKEY,getUser());
          user = getUser();
        }
        if (sUsername.length() > 0) {
          user.setCredentials(new UsernameCredential(sUsername));
          try {
            newIdentityAdapter().authenticate(user);
          } catch (Exception e) {
            String sMsg = "An error occured while evaluating single sign-on credentials for: "+sUsername;
            setUser(new User());
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.security.credentials.UsernameCredential

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.