Examples of BasicAuth


Examples of edu.wpi.cs.wpisuitetng.authentication.BasicAuth

  BasicAuth basic;
 
  @Before
  public void setUp()
  {
    this.basic = new BasicAuth();
  }
View Full Code Here

Examples of edu.wpi.cs.wpisuitetng.authentication.BasicAuth

  SessionManager sessions;
 
  @Before
  public void setUp()
  {
    this.auth = new BasicAuth();
    this.man = ManagerLayer.getInstance();
    this.sessions = man.getSessions();
   
    // add the test user to the database
    DataStore db = DataStore.getDataStore();
View Full Code Here

Examples of edu.wpi.cs.wpisuitetng.authentication.BasicAuth

 
  @Test
  public void testTitle()
  {
    String expectedHeader = "<html> <head> <title> 403 </title> </head>";
    Authenticator auth = new BasicAuth();
    try {
      auth.login("this shoud break it!");
    }
    catch(WPISuiteException e)
    {
      String error = this.formatter.formatContent(e);
      String statusCode = String.valueOf(e.getStatus());
View Full Code Here

Examples of edu.wpi.cs.wpisuitetng.authentication.BasicAuth

  }
 
  @Test
  public void testBody()
  {
    Authenticator auth = new BasicAuth();
    try {
      auth.login("this shoud break it!");
    }
    catch(WPISuiteException e)
    {
      String error = this.formatter.formatContent(e);
      String statusCode = String.valueOf(e.getStatus());
View Full Code Here

Examples of edu.wpi.cs.wpisuitetng.authentication.BasicAuth

  }
 
  @Test
  public void testHTML()
  {
    Authenticator auth = new BasicAuth();
    try {
      auth.login("this shoud break it!");
    }
    catch(WPISuiteException e)
    {
      String error = this.formatter.formatContent(e);
     
View Full Code Here

Examples of edu.wpi.cs.wpisuitetng.authentication.BasicAuth

    /**
     * @see HttpServlet#HttpServlet()
     */
    public WPILoginServlet() {
        super();
        this.auth = new BasicAuth(); // define Authorization implementation
        this.responseFormatter = new JsonErrorResponseFormatter(); // define Response content body format
    }
View Full Code Here

Examples of org.hornetq.rest.queue.push.xml.BasicAuth

   {
      if (registration.getAuthenticationMechanism() != null)
      {
         if (registration.getAuthenticationMechanism().getType() instanceof BasicAuth)
         {
            BasicAuth basic = (BasicAuth) registration.getAuthenticationMechanism().getType();
            UsernamePasswordCredentials creds = new UsernamePasswordCredentials(basic.getUsername(), basic.getPassword());
            AuthScope authScope = new AuthScope(AuthScope.ANY);
            ((DefaultHttpClient)client).getCredentialsProvider().setCredentials(authScope, creds);

            localContext = new BasicHttpContext();
View Full Code Here

Examples of org.hornetq.rest.queue.push.xml.BasicAuth

   {
      if (registration.getAuthenticationMechanism() != null)
      {
         if (registration.getAuthenticationMechanism().getType() instanceof BasicAuth)
         {
            BasicAuth basic = (BasicAuth) registration.getAuthenticationMechanism().getType();
            //log.info("Setting Basic Auth: " + basic.getUsername());
            client.getParams().setAuthenticationPreemptive(true);
            client.getState().setCredentials(
                    //new AuthScope(null, 8080, "Test"),
                    new AuthScope(AuthScope.ANY),
                    new UsernamePasswordCredentials(basic.getUsername(), basic.getPassword())
            );
         }
      }
   }
View Full Code Here

Examples of org.hornetq.rest.queue.push.xml.BasicAuth

      Link pushConsumers = res.getHeaderAsLink("msg-push-consumers");

      // next create the XML document that represents the registration
      // Really, just create a link with the shipping URL and the type you want posted
      PushRegistration reg = new PushRegistration();
      BasicAuth authType = new BasicAuth();
      authType.setUsername("guest");
      authType.setPassword("guest");
      Authentication auth = new Authentication();
      auth.setType(authType);
      reg.setAuthenticationMechanism(auth);
      XmlLink target = new XmlLink();
      target.setHref("http://localhost:9095/queues/jms.queue.shipping");
View Full Code Here

Examples of org.hornetq.rest.queue.push.xml.BasicAuth

   {
      if (registration.getAuthenticationMechanism() != null)
      {
         if (registration.getAuthenticationMechanism().getType() instanceof BasicAuth)
         {
            BasicAuth basic = (BasicAuth) registration.getAuthenticationMechanism().getType();
            //log.info("Setting Basic Auth: " + basic.getUsername());
            client.getParams().setAuthenticationPreemptive(true);
            client.getState().setCredentials(
                    //new AuthScope(null, 8080, "Test"),
                    new AuthScope(AuthScope.ANY),
                    new UsernamePasswordCredentials(basic.getUsername(), basic.getPassword())
            );
         }
      }
   }
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.