Package org.exoplatform.services.security

Examples of org.exoplatform.services.security.Authenticator


          LOG.error("---------------------------------------------------------");
          return false;
      }
       

      Authenticator authenticator = (Authenticator) getContainer()
          .getComponentInstanceOfType(Authenticator.class);

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

      Identity identity = authenticator.createIdentity(username);

      sharedState.put("exo.security.identity", identity);
      sharedState.put("javax.security.auth.login.name", username);
      subject.getPublicCredentials().add(new UsernameCredential(username));
View Full Code Here


    try
    {
      if (super.login())
      {
        Principal principal = this.getIdentity();
        Authenticator authenticator = (Authenticator) getContainer()
            .getComponentInstanceOfType(Authenticator.class);

        this.identity = authenticator.createIdentity(principal.getName());

        return true;
      }
      else
      {
View Full Code Here

        //Check and make sure the IdentityRegistry is consistent
        IdentityRegistry identityRegistry = (IdentityRegistry) getContainer()
            .getComponentInstanceOfType(IdentityRegistry.class);
        if(identityRegistry.getIdentity(remoteUser) == null)
        {
          Authenticator authenticator = (Authenticator) getContainer()
          .getComponentInstanceOfType(Authenticator.class);
         
          Identity identity = authenticator.createIdentity(remoteUser);
         
          identityRegistry.register(identity);
        }
      }
     
View Full Code Here

     {
        log.debug("---------------------------------------");
        log.debug("Username: "+username);
        log.debug("Password: XXXXXXXXXXXXXXXX");

        Authenticator authenticator = (Authenticator) getContainer().getComponentInstanceOfType(Authenticator.class);
               
        Credential[] credentials = new Credential[] { new UsernameCredential(username),
          new PasswordCredential(password) };               

        try
        {
          authenticator.validateUser(credentials);
          return ""+Boolean.TRUE;
        }
        catch(LoginException le)
        {
          return ""+Boolean.FALSE;
View Full Code Here

      try
      {
         log.debug("---------------------------------------");
         log.debug("Going to obtain roles for user: " + username);

         Authenticator authenticator = (Authenticator) getContainer().getComponentInstanceOfType(Authenticator.class);
         Identity identity = authenticator.createIdentity(username);
         Collection<String> roles = identity.getRoles();
        
         StringBuilder result = null;
         for (String role : roles)
         {
View Full Code Here

            if (LOG.isDebugEnabled())
            {
               LOG.debug("Try create identity");
            }

            Authenticator authenticator = (Authenticator)getContainer().getComponentInstanceOfType(Authenticator.class);

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

            String userId = authenticator.validateUser(getCredentials());

            identity = authenticator.createIdentity(userId);
            sharedState.put("javax.security.auth.login.name", userId);
            subject.getPrivateCredentials().add(getPassword());
            subject.getPublicCredentials().add(getUsername());
         }
         return true;
View Full Code Here

         String username = (String)sharedState.get("javax.security.auth.login.name");
         String password = (String)sharedState.get("javax.security.auth.login.password");
         if (username == null || password == null)
            return false;

         Authenticator authenticator = (Authenticator)getContainer().getComponentInstanceOfType(Authenticator.class);

         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);

         subject.getPrivateCredentials().add(password);
View Full Code Here

            String password = new String(((PasswordCallback)callbacks[1]).getPassword());
            ((PasswordCallback)callbacks[1]).clearPassword();
            if (username == null || password == null)
               return false;

            Authenticator authenticator = (Authenticator)getContainer().getComponentInstanceOfType(Authenticator.class);

            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);

            subject.getPrivateCredentials().add(password);
            subject.getPublicCredentials().add(new UsernameCredential(username));
         }
View Full Code Here

            String password = new String(((PasswordCallback)callbacks[1]).getPassword());
            ((PasswordCallback)callbacks[1]).clearPassword();
            if (username == null || password == null)
               return false;

            Authenticator authenticator = (Authenticator)getContainer().getComponentInstanceOfType(Authenticator.class);

            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);

            subject.getPrivateCredentials().add(password);
            subject.getPublicCredentials().add(new UsernameCredential(username));
         }
View Full Code Here

         String username = (String)sharedState.get("javax.security.auth.login.name");
         String password = (String)sharedState.get("javax.security.auth.login.password");
         if (username == null || password == null)
            return false;

         Authenticator authenticator = (Authenticator)getContainer().getComponentInstanceOfType(Authenticator.class);

         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);

         subject.getPrivateCredentials().add(password);
View Full Code Here

TOP

Related Classes of org.exoplatform.services.security.Authenticator

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.