Interface Credential.AccessMethod (1.34.1)

public static interface Credential.AccessMethod

Method of presenting the access token to the resource server as specified in Accessing Protected Resources.

Methods

getAccessTokenFromRequest(HttpRequest request)

public abstract String getAccessTokenFromRequest(HttpRequest request)

Retrieve the original access token in the HTTP request, as provided in #intercept(HttpRequest, String).

Parameter
NameDescription
requestcom.google.api.client.http.HttpRequest

HTTP request

Returns
TypeDescription
String

original access token or null for none

intercept(HttpRequest request, String accessToken)

public abstract void intercept(HttpRequest request, String accessToken)

Intercept the HTTP request during Credential#intercept(HttpRequest) right before the HTTP request executes by providing the access token.

Parameters
NameDescription
requestcom.google.api.client.http.HttpRequest

HTTP request

accessTokenString

access token

Exceptions
TypeDescription
IOException