Examples of BasicAuthentication


Examples of com.genesys.wsclient.impl.BasicAuthentication

      if (username == null)
        throw new NullPointerException("username is null");
      if (password == null)
        throw new NullPointerException("password is null");

      this.authentication = new BasicAuthentication(username, password);
      return this;
    }
View Full Code Here

Examples of com.google.api.client.http.BasicAuthentication

  private Credential createCredential() {
    return new Credential.Builder(BearerToken.queryParameterAccessMethod()).setTransport(
        new MockHttpTransport())
        .setJsonFactory(new MockJsonFactory())
        .setTokenServerUrl(TOKEN_SERVER_URL)
        .setClientAuthentication(new BasicAuthentication(CLIENT_ID, CLIENT_SECRET))
        .build()
        .setAccessToken(ACCESS_TOKEN)
        .setRefreshToken(REFRESH_TOKEN)
        .setExpirationTimeMilliseconds(EXPIRES_IN);
  }
View Full Code Here

Examples of com.google.api.client.http.BasicAuthentication

    transport.statusCode = 500;
    Credential access =
        new Credential.Builder(BearerToken.queryParameterAccessMethod()).setTransport(transport)
            .setJsonFactory(JSON_FACTORY)
            .setTokenServerUrl(TOKEN_SERVER_URL)
            .setClientAuthentication(new BasicAuthentication(CLIENT_ID, CLIENT_SECRET))
            .build()
            .setExpiresInSeconds(3600L)
            .setAccessToken(ACCESS_TOKEN)
            .setRefreshToken(REFRESH_TOKEN);
View Full Code Here

Examples of com.google.api.client.http.BasicAuthentication

    AuthorizationCodeFlow flow =
        new AuthorizationCodeFlow.Builder(BearerToken.queryParameterAccessMethod(),
            new AccessTokenTransport(),
            new JacksonFactory(),
            TOKEN_SERVER_URL,
            new BasicAuthentication(CLIENT_ID, CLIENT_SECRET),
            CLIENT_ID,
            "authorizationServerEncodedUrl").setCredentialCreatedListener(listener).build();
    assertFalse(listener.called);
    flow.createAndStoreCredential(new TokenResponse(), "userId");
    assertTrue(listener.called);
View Full Code Here

Examples of com.google.api.client.http.BasicAuthentication

    AuthorizationCodeFlow flow = new AuthorizationCodeFlow.Builder(BearerToken
        .queryParameterAccessMethod(),
        new AccessTokenTransport(),
        new JacksonFactory(),
        TOKEN_SERVER_URL,
        new BasicAuthentication(CLIENT_ID, CLIENT_SECRET),
        CLIENT_ID,
        "authorizationServerEncodedUrl").addRefreshListener(listener1)
        .addRefreshListener(listener2).build();
    TokenResponse tokenResponse = new TokenResponse();
    tokenResponse.setAccessToken(ACCESS_TOKEN);
View Full Code Here

Examples of com.google.api.client.http.BasicAuthentication

    AuthorizationCodeFlow flow =
        new AuthorizationCodeFlow.Builder(BearerToken.queryParameterAccessMethod(),
            new AccessTokenTransport(),
            new JacksonFactory(),
            TOKEN_SERVER_URL,
            new BasicAuthentication(CLIENT_ID, CLIENT_SECRET),
            CLIENT_ID,
            "https://example.com").setScopes(scopes).build();

    AuthorizationCodeRequestUrl url = flow.newAuthorizationUrl();
    if (scopes.isEmpty()) {
View Full Code Here

Examples of com.google.api.client.http.BasicAuthentication

  private Credential createCredential() {
    Credential access = new Credential.Builder(
        BearerToken.queryParameterAccessMethod()).setTransport(new AccessTokenTransport())
        .setJsonFactory(JSON_FACTORY)
        .setTokenServerUrl(TOKEN_SERVER_URL)
        .setClientAuthentication(new BasicAuthentication(CLIENT_ID, CLIENT_SECRET))
        .build()
        .setAccessToken(ACCESS_TOKEN)
        .setRefreshToken(REFRESH_TOKEN)
        .setExpirationTimeMilliseconds(EXPIRES_IN);
    return access;
View Full Code Here

Examples of com.google.api.client.http.BasicAuthentication

  private Credential createEmptyCredential() {
    Credential access = new Credential.Builder(
        BearerToken.queryParameterAccessMethod()).setTransport(new AccessTokenTransport())
        .setJsonFactory(JSON_FACTORY)
        .setTokenServerUrl(TOKEN_SERVER_URL)
        .setClientAuthentication(new BasicAuthentication(CLIENT_ID, CLIENT_SECRET))
        .build();
    return access;
  }
View Full Code Here

Examples of com.google.api.client.http.BasicAuthentication

      Credential.AccessMethod method, final CheckAuth checkAuth) throws Exception {
    final Credential credential =
        new Credential.Builder(method).setTransport(new AccessTokenTransport())
            .setJsonFactory(JSON_FACTORY)
            .setTokenServerUrl(TOKEN_SERVER_URL)
            .setClientAuthentication(new BasicAuthentication(CLIENT_ID, CLIENT_SECRET))
            .build()
            .setAccessToken(ACCESS_TOKEN)
            .setRefreshToken(REFRESH_TOKEN);
    class MyTransport extends MockHttpTransport {
      boolean resetAccessToken;
View Full Code Here

Examples of com.google.api.client.http.BasicAuthentication

    AccessTokenTransport transport = new AccessTokenTransport();
    Credential access =
        new Credential.Builder(BearerToken.queryParameterAccessMethod()).setTransport(transport)
            .setJsonFactory(JSON_FACTORY)
            .setTokenServerUrl(TOKEN_SERVER_URL)
            .setClientAuthentication(new BasicAuthentication(CLIENT_ID, CLIENT_SECRET))
            .build()
            .setAccessToken(ACCESS_TOKEN);
    assertFalse(access.refreshToken());
    assertEquals(ACCESS_TOKEN, access.getAccessToken());
    assertNull(access.getRefreshToken());
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.