Class BearerToken.FormEncodedBodyAccessMethod
java.lang.Object
com.google.api.client.auth.oauth2.BearerToken.FormEncodedBodyAccessMethod
- All Implemented Interfaces:
Credential.AccessMethod
- Enclosing class:
BearerToken
static final class BearerToken.FormEncodedBodyAccessMethod
extends Object
implements Credential.AccessMethod
Immutable and thread-safe OAuth 2.0 method for accessing protected resources using the Form-Encoded Body 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)
.getData
(com.google.api.client.http.HttpRequest request) void
Intercept the HTTP request duringCredential.intercept(HttpRequest)
right before the HTTP request executes by providing the access token.
-
Constructor Details
-
FormEncodedBodyAccessMethod
FormEncodedBodyAccessMethod()
-
-
Method Details
-
intercept
public void intercept(com.google.api.client.http.HttpRequest request, String accessToken) throws IOException Description copied from interface:Credential.AccessMethod
Intercept the HTTP request duringCredential.intercept(HttpRequest)
right before the HTTP request executes by providing the access token.- Specified by:
intercept
in interfaceCredential.AccessMethod
- Parameters:
request
- HTTP requestaccessToken
- access token- Throws:
IOException
-
getAccessTokenFromRequest
Description copied from interface:Credential.AccessMethod
Retrieve the original access token in the HTTP request, as provided inCredential.AccessMethod.intercept(HttpRequest, String)
.- Specified by:
getAccessTokenFromRequest
in interfaceCredential.AccessMethod
- Parameters:
request
- HTTP request- Returns:
- original access token or
null
for none
-
getData
-