Examples of authenticate()


Examples of org.apache.commons.httpclient.auth.AuthScheme.authenticate()

            if (LOG.isDebugEnabled()) {
                LOG.debug("Authenticating with " + authscope);
            }
            Credentials credentials = this.state.getCredentials(authscope);
            if (credentials != null) {
                String authstring = authscheme.authenticate(credentials, method);
                if (authstring != null) {
                    method.addRequestHeader(new Header(WWW_AUTH_RESP, authstring, true));
                }
            } else {
                if (LOG.isWarnEnabled()) {
View Full Code Here

Examples of org.apache.commons.httpclient.auth.BasicScheme.authenticate()

  private boolean checkAuthorization(Header clientAuth) {
    // TODO Auto-generated method stub
    BasicScheme scheme;
    try {
      scheme = new BasicScheme("basic realm=test");
      String expectedAuthString = scheme.authenticate(credentials, null, null);
      return expectedAuthString.equals(clientAuth.getValue());
    } catch (MalformedChallengeException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (AuthenticationException e) {
View Full Code Here

Examples of org.apache.commons.net.nntp.NNTPClient.authenticate()

       
        NNTPClient client = new NNTPClient();
        client.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));
        client.connect(hostname);
       
        if(!client.authenticate(user, password)) {
            System.out.println("Authentication failed for user " + user + "!");
            System.exit(1);
        }
       
        NewsgroupInfo group = new NewsgroupInfo();
View Full Code Here

Examples of org.apache.cxf.authservice.AuthService.authenticate()

        ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
        proxyFactory.setDataBinding(aegisBinding);
        proxyFactory.setServiceClass(AuthService.class);
        proxyFactory.setAddress("http://localhost:9002/service");
        AuthService service = (AuthService) proxyFactory.create();
        assertTrue(service.authenticate("Joe", "Joe", "123"));
        assertFalse(service.authenticate("Joe1", "Joe", "fang"));     
        assertTrue(service.authenticate("Joe", null, "123"));
        List<String> list = service.getRoles("Joe");
        assertEquals(3, list.size());
        assertEquals("Joe", list.get(0));
View Full Code Here

Examples of org.apache.derby.iapi.jdbc.AuthenticationService.authenticate()

      throw newSQLException(SQLState.LOGIN_FAILED, failedString);
    }
   
    // Let's authenticate now
     
    if (!authenticationService.authenticate(
                         dbname,
                         userInfo
                         )) {

      throw newSQLException(SQLState.LOGIN_FAILED, MessageService.getTextMessage(MessageId.AUTH_INVALID));
View Full Code Here

Examples of org.apache.ftpserver.ftplet.UserManager.authenticate()

                } else {
                    auth = new UsernamePasswordAuthentication(userName,
                            password, userMetadata);
                }

                authenticatedUser = userManager.authenticate(auth);
            } catch (AuthenticationFailedException e) {
                LOG.warn("User failed to log in");
            } catch (Exception e) {
                authenticatedUser = null;
                LOG.warn("PASS.execute()", e);
View Full Code Here

Examples of org.apache.hive.service.auth.PasswdAuthenticationProvider.Authenticate()

    if (!authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.NOSASL.toString())) {
      try {
        AuthMethods authMethod = AuthMethods.getValidAuthMethod(authType);
        PasswdAuthenticationProvider provider =
            AuthenticationProviderFactory.getAuthenticationProvider(authMethod);
        provider.Authenticate(userName, getPassword(request, authType));

      } catch (Exception e) {
        throw new HttpAuthenticationException(e);
      }
    }
View Full Code Here

Examples of org.apache.http.auth.AuthScheme.authenticate()

            return;
        }

        if (authState.getAuthScope() != null || !authScheme.isConnectionBased()) {
            try {
                request.addHeader(authScheme.authenticate(creds, request));
            } catch (AuthenticationException ex) {
                if (this.log.isErrorEnabled()) {
                    this.log.error("Authentication error: " + ex.getMessage());
                }
            }
View Full Code Here

Examples of org.apache.http.auth.ContextAwareAuthScheme.authenticate()

        Mockito.doThrow(new AuthenticationException()).when(authScheme1).authenticate(
                Mockito.any(Credentials.class),
                Mockito.any(HttpRequest.class),
                Mockito.any(HttpContext.class));
        final ContextAwareAuthScheme authScheme2 = Mockito.mock(ContextAwareAuthScheme.class);
        Mockito.when(authScheme2.authenticate(
                Mockito.any(Credentials.class),
                Mockito.any(HttpRequest.class),
                Mockito.any(HttpContext.class))).thenReturn(new BasicHeader(AUTH.WWW_AUTH_RESP, "stuff"));
        authOptions.add(new AuthOption(authScheme1, this.credentials));
        authOptions.add(new AuthOption(authScheme2, this.credentials));
View Full Code Here

Examples of org.apache.http.impl.auth.BasicScheme.authenticate()

        try {
          HttpPost httpPost = new HttpPost(URL);
          System.out.println(URL);
            UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(username, password);
            BasicScheme scheme = new BasicScheme();
            Header authorizationHeader = scheme.authenticate(credentials, httpPost);
            httpPost.setHeader(authorizationHeader);
            httpPost.setEntity(input);
            //System.out.println("Executing request: " + httpGet.getRequestLine());
            //System.out.println(response);
//            response = httpclient.execute(httpGet,responseHandler);
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.