Examples of UsernameCredential


Examples of org.exoplatform.services.security.UsernameCredential

   public void testAuthenticator() throws Exception
   {
      assertNotNull(authenticator);
      assertTrue(authenticator instanceof OrganizationAuthenticatorImpl);
      Credential[] cred = new Credential[]{new UsernameCredential("admin"), new PasswordCredential("admin")};
      String userId = authenticator.validateUser(cred);
      assertEquals("admin", userId);
      Identity identity = authenticator.createIdentity(userId);
      assertTrue(identity.getGroups().size() > 0);
   }
View Full Code Here

Examples of org.exoplatform.services.security.UsernameCredential

        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);
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("Error on retrieving username from callback handler! ", e);
         }
      }

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

Examples of org.exoplatform.services.security.UsernameCredential

         {
            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);
         subject.getPublicCredentials().add(new UsernameCredential(username));
         return true;
      }
      catch (final Exception e)
      {
         if (LOG.isDebugEnabled())
View Full Code Here

Examples of org.exoplatform.services.security.UsernameCredential

            {
               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));
         }
         return true;

      }
      catch (final Exception e)
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("Error on retrieving username from callback handler! ", e);
         }
      }

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

Examples of org.exoplatform.services.security.UsernameCredential

            {
               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));
         }
         return true;

      }
      catch (final Exception e)
View Full Code Here

Examples of org.exoplatform.services.security.UsernameCredential

         {
            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);
         subject.getPublicCredentials().add(new UsernameCredential(username));
         return true;
      }
      catch (final Exception e)
      {
         LoginException le = new LoginException(e.getMessage());
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.