Package com.google.api.explorer.client.AuthManager

Examples of com.google.api.explorer.client.AuthManager.AuthToken


    display.hideScopeDialog();
    EasyMock.expectLastCall();
    display.setState(State.PRIVATE, authScopes, authScopes);
    EasyMock.expectLastCall();

    AuthToken token = EasyMock.createMock(AuthToken.class);
    EasyMock.expect(token.getScopes()).andReturn(authScopes);
    EasyMock.expect(authManager.getToken(service)).andReturn(token);

    EasyMock.replay(service, display, method1, method2, authManager, token);

    AuthPresenter presenter = new AuthPresenter(service, authManager, analytics, display);
View Full Code Here


    // Do not send the API key if the service is a public-only API.
    req.setUseApiKey(
        !ExplorerConfig.PUBLIC_ONLY_APIS.contains(service.getName()));

    // Set the auth header if we have a token.
    AuthToken oauth2Token = authManager.getToken(service);
    if (oauth2Token != null) {
      req.addHeader("Authorization", "Bearer " + oauth2Token.getAuthToken());
    }

    display.setExecuting(true);

    final long start = System.currentTimeMillis();
View Full Code Here

      display.setScopes(Collections.<String, AuthScope>emptyMap());
    } else {
      display.setScopes(service.getAuth().get(OAUTH2_KEY).getScopes());
    }

    AuthToken existingToken = authManager.getToken(service);
    if (existingToken != null) {
      display.setState(State.PRIVATE, requiredScopes, existingToken.getScopes());
      display.preSelectScopes(existingToken.getScopes());
    } else {
      display.setState(State.PUBLIC, requiredScopes, Collections.<String>emptySet());
      display.preSelectScopes(requiredScopes);
    }
  }
View Full Code Here

TOP

Related Classes of com.google.api.explorer.client.AuthManager.AuthToken

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.