Examples of AuthScheme


Examples of org.apache.http.auth.AuthScheme

      {
         AuthState authState = (AuthState) context.getAttribute(ClientContext.TARGET_AUTH_STATE);

         // If no auth scheme available yet, try to initialize it preemptively
         if (authState.getAuthScheme() == null) {
            AuthScheme authScheme = (AuthScheme) context.getAttribute("preemptive-auth");
            CredentialsProvider credsProvider = (CredentialsProvider) context.getAttribute(ClientContext.CREDS_PROVIDER);
            HttpHost targetHost = (HttpHost) context.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
            if (authScheme != null) {
               Credentials creds = credsProvider.getCredentials(new AuthScope(targetHost.getHostName(), targetHost.getPort()));
               if (creds == null) {
View Full Code Here

Examples of org.apache.http.auth.AuthScheme

                    if (this.log.isDebugEnabled()) {
                        this.log.debug("[exchange: " + state.getId() + "] Resetting target auth state");
                    }
                    targetAuthState.reset();
                    final AuthState proxyAuthState = localContext.getProxyAuthState();
                    final AuthScheme authScheme = proxyAuthState.getAuthScheme();
                    if (authScheme != null && authScheme.isConnectionBased()) {
                        if (this.log.isDebugEnabled()) {
                            this.log.debug("[exchange: " + state.getId() + "] Resetting proxy auth state");
                        }
                        proxyAuthState.reset();
                    }
View Full Code Here

Examples of org.opensocial.auth.AuthScheme

  @Test
  public void testBuildRpcUrl() throws RequestException, IOException {
    IMocksControl mockControl = EasyMock.createControl();

    HttpClient httpClient = mockControl.createMock(HttpClient.class);
    AuthScheme authScheme = mockControl.createMock(AuthScheme.class);

    OrkutProvider provider = new OrkutProvider();

    Client client = new Client(provider, authScheme, httpClient);

    Request request = new Request(null, null, null);
    request.addRpcQueryStringParameter("key1", "value1");
    request.addRpcQueryStringParameter("key2", "value2");

    String rpcUrl = provider.getRpcEndpoint();
    rpcUrl = rpcUrl.substring(0, rpcUrl.length() - 1);
    String rpcUrl1 = rpcUrl + "?key1=value1&key2=value2";
    String rpcUrl2 = rpcUrl + "?key2=value2&key1=value1";

    EasyMock.expect(authScheme.getHttpMessage(eq(provider), eq("POST"),
        or(eq(rpcUrl1), eq(rpcUrl2)), isA(Map.class), isA(byte[].class)))
        .andReturn(null);

    HttpResponseMessage httpResponseMessage = new HttpResponseMessage("GET",
        new URL(provider.getRpcEndpoint()), 200, stringToInputStream("[]"));
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.