Examples of UsernamePasswordCredentials


Examples of org.apache.http.auth.UsernamePasswordCredentials

  public XMLRPCClient(URI uri, String username, String password) {
        this(uri);
       
        ((DefaultHttpClient) client).getCredentialsProvider().setCredentials(
        new AuthScope(uri.getHost(), uri.getPort(),AuthScope.ANY_REALM),
        new UsernamePasswordCredentials(username, password));
    }
View Full Code Here

Examples of org.apache.http.auth.UsernamePasswordCredentials

  public XMLRPCClient(URI uri, String username, String password, HttpClient client) {
        this(uri, client);
       
        ((DefaultHttpClient) this.client).getCredentialsProvider().setCredentials(
        new AuthScope(uri.getHost(), uri.getPort(),AuthScope.ANY_REALM),
        new UsernamePasswordCredentials(username, password));
    }
View Full Code Here

Examples of org.apache.http.auth.UsernamePasswordCredentials

    if(doPreemptiveAuth = true) {
      this.httpPreAuth = doPreemptiveAuth;
      this.username = username;
      this.password = password;
    } else {
      ((DefaultHttpClient) client).getCredentialsProvider().setCredentials(new AuthScope(postMethod.getURI().getHost(), postMethod.getURI().getPort(), AuthScope.ANY_REALM), new UsernamePasswordCredentials(username, password));
    }
  }
View Full Code Here

Examples of org.apache.http.auth.UsernamePasswordCredentials

        // 3. claim task from user1, not in role 7 (designated for
        // approval in workflow definition): fail
        PreemptiveAuthHttpRequestFactory requestFactory = ((PreemptiveAuthHttpRequestFactory) restTemplate.
                getRequestFactory());
        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
                requestFactory.getAuthScope(), new UsernamePasswordCredentials("user1", "password"));

        SyncopeClientException sce = null;
        try {
            restTemplate.getForObject(BASE_URL + "user/workflow/form/claim/{taskId}", WorkflowFormTO.class, form.
                    getTaskId());
        } catch (SyncopeClientCompositeErrorException scce) {
            sce = scce.getException(SyncopeClientExceptionType.Workflow);
        }
        assertNotNull(sce);

        // 4. claim task from user4, in to role 7
        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
                requestFactory.getAuthScope(), new UsernamePasswordCredentials("user4", "password"));

        form = restTemplate.getForObject(BASE_URL + "user/workflow/form/claim/{taskId}", WorkflowFormTO.class, form.
                getTaskId());
        assertNotNull(form);
        assertNotNull(form.getTaskId());
View Full Code Here

Examples of org.apache.http.auth.UsernamePasswordCredentials

                && AsyncHTTPConduit.this.proxyAuthorizationPolicy.getUserName() != null) {
                ctx.setAttribute(ClientContext.CREDS_PROVIDER, new CredentialsProvider() {
                    public void setCredentials(AuthScope authscope, Credentials credentials) {
                    }
                    public Credentials getCredentials(AuthScope authscope) {
                        return new UsernamePasswordCredentials(AsyncHTTPConduit.this
                                                               .proxyAuthorizationPolicy.getUserName(),
                                               AsyncHTTPConduit.this.proxyAuthorizationPolicy.getPassword());
                    }
                    public void clear() {
                    }
View Full Code Here

Examples of org.jasig.cas.authentication.principal.UsernamePasswordCredentials

        EasyMock.expect(userPasswordDao.getPasswordHash("admin")).andReturn("(MD5)OP2Z89LDMIY6gHAwfoFPRSQWDl5Z16Vt");
       
        final PersonDirAuthenticationHandler authenticationHandler = new PersonDirAuthenticationHandler();
        authenticationHandler.setUserPasswordDao(userPasswordDao);
       
        final UsernamePasswordCredentials credentials = new UsernamePasswordCredentials();
        credentials.setUsername("admin");
        credentials.setPassword("admin");
       
        EasyMock.replay(userPasswordDao);
       
        final boolean auth = authenticationHandler.authenticateUsernamePasswordInternal(credentials);
       
View Full Code Here

Examples of org.pac4j.http.credentials.UsernamePasswordCredentials

    @Override
    protected UsernamePasswordCredentials retrieveCredentials(final WebContext context) throws RequiresHttpAction {
        final String username = context.getRequestParameter(this.usernameParameter);
        final String password = context.getRequestParameter(this.passwordParameter);
        if (CommonHelper.isNotBlank(username) && CommonHelper.isNotBlank(password)) {
            final UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(username, password,
                                                                                            getName());
            logger.debug("usernamePasswordCredentials : {}", credentials);
            try {
                // validate credentials
                this.usernamePasswordAuthenticator.validate(credentials);
View Full Code Here

Examples of org.picketlink.idm.credential.UsernamePasswordCredentials

     * @param user
     * @param password
     * @return builder implementation
     */
    public void validate(User user, String password) {
        Credentials credential = new UsernamePasswordCredentials(user.getLoginName(), new Password(password));
        identityManager.validateCredentials(credential);
        this.credential = credential;
    }
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.