Class BearerToken.QueryParameterAccessMethod
java.lang.Object
com.google.api.client.auth.oauth2.BearerToken.QueryParameterAccessMethod
- All Implemented Interfaces:
Credential.AccessMethod
- Enclosing class:
BearerToken
static final class BearerToken.QueryParameterAccessMethod
extends Object
implements Credential.AccessMethod
Immutable and thread-safe OAuth 2.0 method for accessing protected resources using the URI Query Parameter.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAccessTokenFromRequest(com.google.api.client.http.HttpRequest request) Retrieve the original access token in the HTTP request, as provided inCredential.AccessMethod.intercept(HttpRequest, String).voidIntercept the HTTP request duringCredential.intercept(HttpRequest)right before the HTTP request executes by providing the access token.
-
Constructor Details
-
QueryParameterAccessMethod
QueryParameterAccessMethod()
-
-
Method Details
-
intercept
public void intercept(com.google.api.client.http.HttpRequest request, String accessToken) throws IOException Description copied from interface:Credential.AccessMethodIntercept the HTTP request duringCredential.intercept(HttpRequest)right before the HTTP request executes by providing the access token.- Specified by:
interceptin interfaceCredential.AccessMethod- Parameters:
request- HTTP requestaccessToken- access token- Throws:
IOException
-
getAccessTokenFromRequest
Description copied from interface:Credential.AccessMethodRetrieve the original access token in the HTTP request, as provided inCredential.AccessMethod.intercept(HttpRequest, String).- Specified by:
getAccessTokenFromRequestin interfaceCredential.AccessMethod- Parameters:
request- HTTP request- Returns:
- original access token or
nullfor none
-