Examples of UsernameCredential


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

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

    } 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

Examples of org.exoplatform.services.security.UsernameCredential

         if (authenticator == null)
            throw new LoginException("No Authenticator component found, check your configuration");

         Credential[] credentials =
            new Credential[]{new UsernameCredential(username), new PasswordCredential(password)};

         String userId = authenticator.validateUser(credentials);
         Identity identity = authenticator.createIdentity(userId);

         sharedState.put("exo.security.identity", identity);
         sharedState.put("javax.security.auth.login.name", userId);
         // TODO use PasswordCredential wrapper
         subject.getPrivateCredentials().add(password);
         subject.getPublicCredentials().add(new UsernameCredential(username));
         return true;
      }
      catch (final Throwable e)
      {
         LoginException le = new LoginException(e.getMessage());
View Full Code Here

Examples of org.exoplatform.services.security.UsernameCredential

            if (authenticator == null)
               throw new LoginException("No Authenticator component found, check your configuration");

            Credential[] credentials =
               new Credential[]{new UsernameCredential(username), new PasswordCredential(password)};

            String userId = authenticator.validateUser(credentials);
            identity = authenticator.createIdentity(userId);
            sharedState.put("javax.security.auth.login.name", userId);
            // TODO use PasswordCredential wrapper
            subject.getPrivateCredentials().add(password);
            subject.getPublicCredentials().add(new UsernameCredential(username));
         }
         return true;

      }
      catch (final Throwable e)
View Full Code Here

Examples of org.exoplatform.services.security.UsernameCredential

      if (authenticator == null)
         throw new LoginException("No Authenticator component found, check your configuration");

      Credential[] credentials =
         new Credential[]{new UsernameCredential(this.userName), new PasswordCredential(this.userPass)};

      this.userId = authenticator.validateUser(credentials);
      Identity identity = authenticator.createIdentity(this.userId);
      identityRegistry.register(identity);
View Full Code Here

Examples of org.exoplatform.services.security.UsernameCredential

            if (authenticator == null)
               throw new LoginException("No Authenticator component found, check your configuration");

            Credential[] credentials =
               new Credential[]{new UsernameCredential(username), new PasswordCredential(password)};

            String userId = authenticator.validateUser(credentials);
            identity = authenticator.createIdentity(userId);
            sharedState.put("javax.security.auth.login.name", userId);
            // TODO use PasswordCredential wrapper
            subject.getPrivateCredentials().add(password);
            subject.getPublicCredentials().add(new UsernameCredential(username));
         }
         return true;

      }
      catch (final Throwable e)
View Full Code Here

Examples of org.exoplatform.services.security.UsernameCredential

            String confirmnewPass = uiForm.getUIStringInput("confirmnewpass").getValue();

            Authenticator authenticator = uiForm.getApplicationComponent(Authenticator.class);
            boolean authenticated;
            try {
                UsernameCredential usernameCred = new UsernameCredential(username);
                PasswordCredential passwordCred = new PasswordCredential(currentPass);
                authenticator.validateUser(new Credential[] { usernameCred, passwordCred });
                authenticated = true;
            } catch (Exception ex) {
                authenticated = false;
View Full Code Here

Examples of org.exoplatform.services.security.UsernameCredential

      if (username == null || password == null)
      {
         return null;
      }

      return new Credential[]{new UsernameCredential(username), new PasswordCredential(password, passwordContext)};
   }
View Full Code Here

Examples of org.exoplatform.services.security.UsernameCredential

         {
            log.error("Could not get username.", e);
         }
      }

      return new UsernameCredential(username);
   }
View Full Code Here

Examples of org.exoplatform.services.security.UsernameCredential

      if (username == null || password == null)
      {
         return null;
      }

      return new Credential[]{new UsernameCredential(username), new PasswordCredential(password, passwordContext)};
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.