Interface Credential.AccessMethod (1.36.0)

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
Name Description
request com.google.api.client.http.HttpRequest

HTTP request

Returns
Type Description
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
Name Description
request com.google.api.client.http.HttpRequest

HTTP request

accessToken String

access token

Exceptions
Type Description
IOException