public abstract class OAuthImplicitGrant extends Authentication
You can use an instance of this class as the AuthorizationData#getAuthentication"
method
of an AuthorizationData
object to authenticate with Bing Ads services.
In this case the AuthenticationToken request header will be set to the corresponding OAuthTokens.getAccessToken()
value.
This class implements the implicit grant flow for Managing User Authentication with OAuth documented at http://go.microsoft.com/fwlink/?LinkID=511608. This is a standard OAuth 2.0 flow and is defined in detail in the Authorization Code Grant section of the OAuth 2.0 spec at http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-4.1. For more information about registering a Bing Ads application, see http://go.microsoft.com/fwlink/?LinkID=511607.
Modifier and Type | Field and Description |
---|---|
protected ApiEnvironment |
environment |
protected OAuthTokens |
oAuthTokens
OAuth tokens received from live.com authorization service.
|
Modifier | Constructor and Description |
---|---|
protected |
OAuthImplicitGrant(String clientId,
URL redirectionUri,
OAuthTokens oauthTokens,
ApiEnvironment env,
OAuthScope oAuthScope) |
Modifier and Type | Method and Description |
---|---|
void |
addHeaders(HeadersImpl headersImplementation)
Adds the AuthenticationToken header element for the corresponding bulk file upload operation.
|
OAuthTokens |
extractAccessTokenFromUrl(URL redirectionUri)
Extracts the access token from the specified
|
String |
getAuthenticationToken() |
URL |
getAuthorizationEndpoint()
Gets the Microsoft Account authorization endpoint where the user should be navigated to give his or her consent.
|
ApiEnvironment |
getEnvironment() |
OAuthTokens |
getOAuthTokens()
Gets information about OAuth access tokens received from the Microsoft Account authorization service.
|
String |
getState() |
String |
getTenant() |
void |
setEnvironment(ApiEnvironment environment) |
protected void |
setOAuthTokens(OAuthTokens oAuthTokens)
Sets information about OAuth access tokens received from the Microsoft Account authorization service.
|
void |
setState(String state) |
void |
setTenant(String tenant) |
protected OAuthTokens oAuthTokens
OAuthDesktopMobileImplicitGrant
and
OAuthWithAuthorizationCode
protected ApiEnvironment environment
protected OAuthImplicitGrant(String clientId, URL redirectionUri, OAuthTokens oauthTokens, ApiEnvironment env, OAuthScope oAuthScope)
public URL getAuthorizationEndpoint()
URL
.public OAuthTokens extractAccessTokenFromUrl(URL redirectionUri)
redirectionUri
- the redirect URL
that contains an access tokenOAuthTokens
objectpublic void setTenant(String tenant)
public String getTenant()
public void setState(String state)
public String getState()
public OAuthTokens getOAuthTokens()
protected void setOAuthTokens(OAuthTokens oAuthTokens)
public String getAuthenticationToken()
public void addHeaders(HeadersImpl headersImplementation)
addHeaders
in class Authentication
headersImplementation
- the headers collection to which authentication requests should be addedpublic ApiEnvironment getEnvironment()
getEnvironment
in class Authentication
public void setEnvironment(ApiEnvironment environment)
Copyright © 2024. All rights reserved.