com.google.api.ads.common.lib.auth
Class AuthorizationHeaderProvider
java.lang.Object
com.google.api.ads.common.lib.auth.AuthorizationHeaderProvider
public class AuthorizationHeaderProvider
- extends Object
Authorization header provider that can delegate between different
authentication mechanisms depending on the AdsSession.
- Author:
- Adam Rogal
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AuthorizationHeaderProvider
@Inject
public AuthorizationHeaderProvider(OAuthAuthorizationHeaderProvider oAuthAuthorizationHeaderProvider,
OAuth2AuthorizationHeaderProvider oAuth2AuthorizationHeaderProvider,
com.google.api.ads.common.lib.conf.AdsLibConfiguration adsLibConfiguration,
OAuth2Helper oAuth2Helper)
- Constructor.
- Parameters:
oAuthAuthorizationHeaderProvider - the OAuth header provideroAuth2AuthorizationHeaderProvider - the OAuth2 header provideradsLibConfiguration - the library configurationoAuth2Helper - the OAuth2 helper
getAuthorizationHeader
public String getAuthorizationHeader(AdsSession adsSession,
@Nullable
String endpointUrl)
throws AuthenticationException
- Gets a header value that can be set to the
Authorization HTTP
header. The endpoint URL can be null if it's not needed for the
authentication mechanism (i.e. OAuth2).
- Parameters:
adsSession - the session to pull authentication information fromendpointUrl - the endpoint URL used for authentication mechanisms like
OAuth.
- Returns:
- the authorization header
- Throws:
AuthenticationException - if the authorization header could not be
created
IllegalArgumentException - if no valid authentication information
exists within the session.
Copyright © 2012. All Rights Reserved.