public abstract class OAuthWithAuthorizationCode extends Authentication
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 |
OAuthWithAuthorizationCode(String clientId,
String clientSecret,
URL redirectionUri,
ApiEnvironment env,
OAuthScope oAuthScope) |
protected |
OAuthWithAuthorizationCode(String clientId,
String clientSecret,
URL redirectionUri,
OAuthService oauthService,
ApiEnvironment env,
OAuthScope oAuthScope) |
protected |
OAuthWithAuthorizationCode(String clientId,
String clientSecret,
URL redirectionUri,
OAuthTokens oauthTokens,
ApiEnvironment env,
OAuthScope oAuthScope) |
protected |
OAuthWithAuthorizationCode(String clientId,
String clientSecret,
URL redirectionUri,
String refreshToken,
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.
|
String |
getAuthenticationToken() |
URL |
getAuthorizationEndpoint()
Returns OAuth Authorization Endpoint that the user has to navigate to from the browser in order to get to the user consent page.
|
String |
getClientId() |
String |
getClientSecret() |
ApiEnvironment |
getEnvironment() |
NewOAuthTokensReceivedListener |
getNewTokensListener() |
OAuthScope |
getOAuthScope() |
OAuthTokens |
getOAuthTokens()
Gets information about OAuth access tokens received from the Microsoft Account authorization service.
|
String |
getState() |
String |
getTenant() |
OAuthTokens |
refreshTokensIfNeeded(boolean forceRefresh)
Retrieves OAuth tokens from authorization server using the last known refresh token from the current session.
|
OAuthTokens |
requestAccessAndRefreshTokens(String refreshToken)
Retrieves OAuth tokens from authorization server using the refresh token provided by user.
|
OAuthTokens |
requestAccessAndRefreshTokens(URL responseUrl)
Retrieves OAuth tokens from authorization server using the authorization code provided by user.
|
OAuthTokens |
requestAccessAndRefreshTokens(URL responseUrl,
Map<String,String> additionalParams)
Retrieves OAuth tokens from authorization server using the authorization code provided by user.
|
void |
setEnvironment(ApiEnvironment environment) |
void |
setNewTokensListener(NewOAuthTokensReceivedListener newTokensListener) |
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 OAuthWithAuthorizationCode(String clientId, String clientSecret, URL redirectionUri, String refreshToken, ApiEnvironment env, OAuthScope oAuthScope)
protected OAuthWithAuthorizationCode(String clientId, String clientSecret, URL redirectionUri, OAuthTokens oauthTokens, ApiEnvironment env, OAuthScope oAuthScope)
protected OAuthWithAuthorizationCode(String clientId, String clientSecret, URL redirectionUri, ApiEnvironment env, OAuthScope oAuthScope)
protected OAuthWithAuthorizationCode(String clientId, String clientSecret, URL redirectionUri, OAuthService oauthService, ApiEnvironment env, OAuthScope oAuthScope)
public String getClientId()
public String getClientSecret()
public OAuthScope getOAuthScope()
public URL getAuthorizationEndpoint()
public OAuthTokens requestAccessAndRefreshTokens(URL responseUrl)
responseUrl
- Authorization response redirect Uri containing the authorization code. See: {"http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-4.1.2"}public OAuthTokens requestAccessAndRefreshTokens(URL responseUrl, Map<String,String> additionalParams)
responseUrl
- Authorization response redirect Uri containing the authorization code. See: {"http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-4.1.2"}additionalParams
- Additional parameters in format of Key/Value. Such as "code_verifier" can leverage this parameterpublic OAuthTokens requestAccessAndRefreshTokens(String refreshToken)
refreshToken
- Refresh token. See "http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-6".public OAuthTokens refreshTokensIfNeeded(boolean forceRefresh)
When the current access token expires, it needs to be refreshed. It can be refreshed using the refresh token that was receive before (either provided directly by user or retrieved using the authorization code). The ServiceClient
detects access token expiration and calls this method to refresh it.
forceRefresh
- public NewOAuthTokensReceivedListener getNewTokensListener()
public void setNewTokensListener(NewOAuthTokensReceivedListener newTokensListener)
public 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.