Package org.apache.http.auth

Examples of org.apache.http.auth.BasicUserPrincipal


    }

    private void configureHttpClient(final DefaultHttpClient httpclient) throws GeneralSecurityException {
        configureTrust(httpclient);

        configureAuthentication(httpclient, BASIC, new BasicUserPrincipal(username));

        if (enableKerberos) {
            String spnServiceClass = kerberosUseHttpSpn ? "HTTP" : "WSMAN";
            httpclient.getAuthSchemes().register(KERBEROS,
                    new WsmanKerberosSchemeFactory(!kerberosAddPortToSpn, spnServiceClass, unmappedAddress, unmappedPort));
View Full Code Here


    }

    @Test
    public void testPrincipalCurrentUserInfo() {
        final String userName = "testUser";
        final Principal principal = new BasicUserPrincipal(userName);
        new NonStrictExpectations() {{
            FacesContext.getCurrentInstance(); result = facesContext;
            facesContext.getExternalContext(); result = externalContext;
            externalContext.getUserPrincipal(); result = principal;
        }};
View Full Code Here

  private static class SetupFilter implements Filter {
    private Subject subject;

    public SetupFilter( String userName ) {
      subject = new Subject();
      subject.getPrincipals().add( new BasicUserPrincipal( userName ) );
    }
View Full Code Here

  private static class SetupFilter implements Filter {
    private Subject subject;

    public SetupFilter( String userName ) {
      subject = new Subject();
      subject.getPrincipals().add( new BasicUserPrincipal( userName ) );
    }
View Full Code Here

        count.countDown();
        return new Credentials()
        {
          public Principal getUserPrincipal()
          {
            return new BasicUserPrincipal("anonymous");
          }

          public String getPassword()
          {
            return "invalid";
View Full Code Here

    {
      if (userName == null)
      {
        principal = null;
      }
      principal = new BasicUserPrincipal( userName );
    }
View Full Code Here

  {
    if (userName == null)
    {
      principal = null;
    }
    principal = new BasicUserPrincipal( userName );
  }
View Full Code Here

        count.countDown();
        return new Credentials()
        {
          public Principal getUserPrincipal()
          {
            return new BasicUserPrincipal("anonymous");
          }

          public String getPassword()
          {
            return "invalid";
View Full Code Here

  private static class SetupFilter implements Filter {
    private Subject subject;

    public SetupFilter( String userName ) {
      subject = new Subject();
      subject.getPrincipals().add( new BasicUserPrincipal( userName ) );
    }
View Full Code Here

TOP

Related Classes of org.apache.http.auth.BasicUserPrincipal

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.