public class AuthorizationHeaderProvider extends Object
AdsSession.| Constructor and Description |
|---|
AuthorizationHeaderProvider(OAuth2AuthorizationHeaderProvider oAuth2AuthorizationHeaderProvider,
com.google.api.ads.common.lib.conf.AdsLibConfiguration adsLibConfiguration,
OAuth2Helper oAuth2Helper)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAuthorizationHeader(AdsSession adsSession,
String endpointUrl)
Gets a header value that can be set to the
Authorization HTTP
header. |
@Inject public AuthorizationHeaderProvider(OAuth2AuthorizationHeaderProvider oAuth2AuthorizationHeaderProvider, com.google.api.ads.common.lib.conf.AdsLibConfiguration adsLibConfiguration, OAuth2Helper oAuth2Helper)
oAuth2AuthorizationHeaderProvider - the OAuth2 header provideradsLibConfiguration - the library configurationoAuth2Helper - the OAuth2 helperpublic String getAuthorizationHeader(AdsSession adsSession, @Nullable String endpointUrl) throws AuthenticationException
Authorization HTTP
header. The endpoint URL can be null if it's not needed for the
authentication mechanism (i.e. OAuth2).adsSession - the session to pull authentication information fromendpointUrl - the endpoint URL used for authentication mechanisms like
OAuth.AuthenticationException - if the authorization header could not be
createdIllegalArgumentException - if no valid authentication information
exists within the session.Copyright © 2015. All Rights Reserved.