Interface Credential.AccessMethod

All Known Implementing Classes:
BearerToken.AuthorizationHeaderAccessMethod, BearerToken.FormEncodedBodyAccessMethod, BearerToken.QueryParameterAccessMethod
Enclosing class:
Credential

public static interface Credential.AccessMethod
Method of presenting the access token to the resource server as specified in Accessing Protected Resources.
  • Method Details

    • intercept

      void intercept(com.google.api.client.http.HttpRequest request, String accessToken) throws IOException
      Intercept the HTTP request during Credential.intercept(HttpRequest) right before the HTTP request executes by providing the access token.
      Parameters:
      request - HTTP request
      accessToken - access token
      Throws:
      IOException
    • getAccessTokenFromRequest

      String getAccessTokenFromRequest(com.google.api.client.http.HttpRequest request)
      Retrieve the original access token in the HTTP request, as provided in intercept(HttpRequest, String).
      Parameters:
      request - HTTP request
      Returns:
      original access token or null for none