Package org.apache.juddi.v3.auth

Examples of org.apache.juddi.v3.auth.Authenticator


       
       
        @Test(expected=UnknownUserException.class)
  public void testBadMD5XMLDocAuthenticator() throws Exception
  {
    Authenticator auth = new MD5XMLDocAuthenticator();
    auth.authenticate("anou_mana","badpass");
  }
View Full Code Here


  }


  public AuthToken getAuthToken(GetAuthToken body)
      throws DispositionReportFaultMessage {
    Authenticator authenticator = AuthenticatorFactory.getAuthenticator();
   
    String publisherId = authenticator.authenticate(body.getUserID(), body.getCred());

    return getAuthToken(publisherId);
  }
View Full Code Here


  public AuthToken getAuthToken(GetAuthToken body)
      throws DispositionReportFaultMessage {

    Authenticator authenticator = AuthenticatorFactory.getAuthenticator();
   
    String publisherId = authenticator.authenticate(body.getUserID(), body.getCred());
   
    if (publisherId == null || publisherId.length() == 0)
      throw new UnknownUserException(new ErrorMessage("errors.auth.InvalidCredentials", publisherId));
   
    EntityManager em = PersistenceManager.getEntityManager();
View Full Code Here

      throw new AuthTokenRequiredException(new ErrorMessage("errors.auth.AuthInvalid"));
   
    if (modelAuthToken.getTokenState() == AUTHTOKEN_RETIRED)
      throw new AuthTokenRequiredException(new ErrorMessage("errors.auth.AuthInvalid"));
   
    Authenticator authenticator = AuthenticatorFactory.getAuthenticator();
    UddiEntityPublisher entityPublisher = authenticator.identify(authInfo, modelAuthToken.getAuthorizedName());
   
    // Must make sure the returned publisher has all the necessary fields filled
    if (entityPublisher == null)
      throw new AuthTokenRequiredException(new ErrorMessage("errors.auth.AuthInvalid"));
View Full Code Here


  public AuthToken getAuthToken(GetAuthToken body)
      throws DispositionReportFaultMessage {

    Authenticator authenticator = AuthenticatorFactory.getAuthenticator();
   
    String publisherId = authenticator.authenticate(body.getUserID(), body.getCred());
   
    return getAuthToken(publisherId);
  }
View Full Code Here

   * @throws JAXBException
   */
  @Test(expected=UnknownUserException.class)
  public void testBadCryptedXMLDocAuthenticator() throws Exception
  {
    Authenticator auth = new CryptedXMLDocAuthenticator();
    auth.authenticate("anou_mana","badpass");
  }
View Full Code Here

   * @throws ConfigurationException
   */
  @Test
  public void testDefaultAuthenticator()
  {
    Authenticator auth = new JUDDIAuthenticator();
    try {
      API_010_PublisherTest api010 = new API_010_PublisherTest();
      api010.saveJoePublisher();
      api010.saveSamSyndicator();

      auth.authenticate("joepublisher","password");
      auth.authenticate("ssyndicator","badpass");
     
    } catch (Exception e) {
      logger.error(e.getMessage(),e);
      Assert.fail("unexpected");
    }
View Full Code Here

  }
  @Test
  public void testCreateJuddiUsers() throws Exception
  {
    try {
      JuddiUsers juddiUsers = new JuddiUsers();
      juddiUsers.getUser().add(new User("anou_mana","password"));
      juddiUsers.getUser().add(new User("bozo","clown"));
      juddiUsers.getUser().add(new User("sviens","password"));
     
      StringWriter writer = new StringWriter();
      JAXBContext context = JAXBContext.newInstance(juddiUsers.getClass());
      Marshaller marshaller = context.createMarshaller();
      marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
      marshaller.marshal(juddiUsers, writer);
      logger.info("\n" +  writer.toString());
    } catch (Exception e) {
View Full Code Here

  @Test
  public void testCreateJuddiUsersEncrypted() throws Exception
  {
    try {
      Cryptor cryptor = (Cryptor) CryptorFactory.getCryptor();
      JuddiUsers juddiUsers = new JuddiUsers();
      juddiUsers.getUser().add(new User("anou_mana",cryptor.encrypt("password")));
      juddiUsers.getUser().add(new User("bozo",cryptor.encrypt("clown")));
      juddiUsers.getUser().add(new User("sviens",cryptor.encrypt("password")));
     
      StringWriter writer = new StringWriter();
      JAXBContext context = JAXBContext.newInstance(juddiUsers.getClass());
      Marshaller marshaller = context.createMarshaller();
      marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
      marshaller.marshal(juddiUsers, writer);
      logger.info("\n" +  writer.toString());
    } catch (Exception e) {
View Full Code Here

  @Test
  public void testCreateJuddiUsers() throws Exception
  {
    try {
      JuddiUsers juddiUsers = new JuddiUsers();
      juddiUsers.getUser().add(new User("anou_mana","password"));
      juddiUsers.getUser().add(new User("bozo","clown"));
      juddiUsers.getUser().add(new User("sviens","password"));
     
      StringWriter writer = new StringWriter();
      JAXBContext context = JAXBContext.newInstance(juddiUsers.getClass());
      Marshaller marshaller = context.createMarshaller();
      marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
View Full Code Here

TOP

Related Classes of org.apache.juddi.v3.auth.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.