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.
- Since:
- 1.7
-
Method Summary
Modifier and TypeMethodDescriptiongetAccessTokenFromRequest(com.google.api.client.http.HttpRequest request) Retrieve the original access token in the HTTP request, as provided inintercept(HttpRequest, String).voidIntercept the HTTP request duringCredential.intercept(HttpRequest)right before the HTTP request executes by providing the access token.
-
Method Details
-
intercept
void intercept(com.google.api.client.http.HttpRequest request, String accessToken) throws IOException Intercept the HTTP request duringCredential.intercept(HttpRequest)right before the HTTP request executes by providing the access token.- Parameters:
request- HTTP requestaccessToken- access token- Throws:
IOException
-
getAccessTokenFromRequest
Retrieve the original access token in the HTTP request, as provided inintercept(HttpRequest, String).- Parameters:
request- HTTP request- Returns:
- original access token or
nullfor none
-