Class OAuth2TestContextImpl
- java.lang.Object
-
- com.boomi.connector.testutil.auth.OAuth2TestContextImpl
-
- All Implemented Interfaces:
OAuth2Context
public class OAuth2TestContextImpl extends Object implements OAuth2Context
BaseOAuth2Contextimplementation This test context implementation should be added as a connection property to test context
-
-
Constructor Summary
Constructors Constructor Description OAuth2TestContextImpl(OAuth2TestConfig config)Creates a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>getAccessTokenParameters()Gets a map of any additional OAuth 2.0 access token parameters These parameters are used when retrieving the access token during the initial access token retrievalStringgetAccessTokenUrl()Get the OAuth 2.0 Access Token URL The Access Token URL is used when retrieving new access and refresh tokens.Map<String,String>getAuthorizationParameters()Gets a map of any additional OAuth 2.0 authorization parameters These parameters are used when retrieving the authorization code during the initial access token retrievalStringgetAuthorizationTokenUrl()Get the OAuth 2.0 Authorization Token URL The authorization token url is used retrieve the authorization code.StringgetClientId()Get the OAuth 2.0 Client IDStringgetClientSecret()Get the OAuth 2.0 Client SecretStringgetGrantType()Get the OAuth 2.0 Grant TypeJwtAssertionParametersgetJwtAssertionParameters()Get the claims used to build the JWT assertion.OAuth2TokengetOAuth2Token(boolean forceUpdate)Retrieves the OAuth2Token.StringgetRefreshToken()Returns the refresh token as provided in configStringgetScope()Get the OAuth 2.0 Access Token scopebooleanisUseRefreshToken()Indicates if this OAuth 2.0 configuration uses refresh tokens
-
-
-
Constructor Detail
-
OAuth2TestContextImpl
public OAuth2TestContextImpl(OAuth2TestConfig config)
Creates a new instance- Parameters:
config- the OAuth2TestConfig for OAuth authentication
-
-
Method Detail
-
getGrantType
public String getGrantType()
Description copied from interface:OAuth2ContextGet the OAuth 2.0 Grant Type- Specified by:
getGrantTypein interfaceOAuth2Context- Returns:
- String grant type
-
getClientId
public String getClientId()
Description copied from interface:OAuth2ContextGet the OAuth 2.0 Client ID- Specified by:
getClientIdin interfaceOAuth2Context- Returns:
- String client id
-
getClientSecret
public String getClientSecret()
Description copied from interface:OAuth2ContextGet the OAuth 2.0 Client Secret- Specified by:
getClientSecretin interfaceOAuth2Context- Returns:
- String encrypted client secret
-
getAuthorizationTokenUrl
public String getAuthorizationTokenUrl()
Description copied from interface:OAuth2ContextGet the OAuth 2.0 Authorization Token URL The authorization token url is used retrieve the authorization code.- Specified by:
getAuthorizationTokenUrlin interfaceOAuth2Context- Returns:
- String authorization token url
-
getAccessTokenUrl
public String getAccessTokenUrl()
Description copied from interface:OAuth2ContextGet the OAuth 2.0 Access Token URL The Access Token URL is used when retrieving new access and refresh tokens.- Specified by:
getAccessTokenUrlin interfaceOAuth2Context- Returns:
- String access token url
-
isUseRefreshToken
public boolean isUseRefreshToken()
Description copied from interface:OAuth2ContextIndicates if this OAuth 2.0 configuration uses refresh tokens- Specified by:
isUseRefreshTokenin interfaceOAuth2Context- Returns:
- boolean true if refresh tokens are used.
-
getAuthorizationParameters
public Map<String,String> getAuthorizationParameters()
Description copied from interface:OAuth2ContextGets a map of any additional OAuth 2.0 authorization parameters These parameters are used when retrieving the authorization code during the initial access token retrieval- Specified by:
getAuthorizationParametersin interfaceOAuth2Context- Returns:
- Map<String, String> parameter name, parameter value
-
getAccessTokenParameters
public Map<String,String> getAccessTokenParameters()
Description copied from interface:OAuth2ContextGets a map of any additional OAuth 2.0 access token parameters These parameters are used when retrieving the access token during the initial access token retrieval- Specified by:
getAccessTokenParametersin interfaceOAuth2Context- Returns:
- Map<String, String> parameter name, parameter value
-
getScope
public String getScope()
Description copied from interface:OAuth2ContextGet the OAuth 2.0 Access Token scope- Specified by:
getScopein interfaceOAuth2Context- Returns:
- String scope
-
getRefreshToken
public String getRefreshToken()
Returns the refresh token as provided in config- Returns:
- the refresh token
-
getOAuth2Token
public OAuth2Token getOAuth2Token(boolean forceUpdate) throws IOException
Retrieves the OAuth2Token. this test method implementation will refresh the access token using the refresh token if force update is true or access token is null.- Specified by:
getOAuth2Tokenin interfaceOAuth2Context- Parameters:
forceUpdate- boolean. If true, will force update of OAuth 2.0 token.- Returns:
- the oauth2 token with a access token
- Throws:
IOException
-
getJwtAssertionParameters
public JwtAssertionParameters getJwtAssertionParameters()
Description copied from interface:OAuth2ContextGet the claims used to build the JWT assertion.- Specified by:
getJwtAssertionParametersin interfaceOAuth2Context- Returns:
- JWT Assertions object.
-
-