Class OAuth2TestContextImpl
- java.lang.Object
-
- com.boomi.connector.testutil.auth.OAuth2TestContextImpl
-
- All Implemented Interfaces:
OAuth2Context
public class OAuth2TestContextImpl extends Object implements OAuth2Context
BaseOAuth2Context
implementation 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 retrievalString
getAccessTokenUrl()
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 retrievalString
getAuthorizationTokenUrl()
Get the OAuth 2.0 Authorization Token URL The authorization token url is used retrieve the authorization code.String
getClientId()
Get the OAuth 2.0 Client IDString
getClientSecret()
Get the OAuth 2.0 Client SecretString
getGrantType()
Get the OAuth 2.0 Grant TypeJwtAssertionParameters
getJwtAssertionParameters()
Get the claims used to build the JWT assertion.OAuth2Token
getOAuth2Token(boolean forceUpdate)
Retrieves the OAuth2Token.String
getRefreshToken()
Returns the refresh token as provided in configString
getScope()
Get the OAuth 2.0 Access Token scopeboolean
isUseRefreshToken()
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:OAuth2Context
Get the OAuth 2.0 Grant Type- Specified by:
getGrantType
in interfaceOAuth2Context
- Returns:
- String grant type
-
getClientId
public String getClientId()
Description copied from interface:OAuth2Context
Get the OAuth 2.0 Client ID- Specified by:
getClientId
in interfaceOAuth2Context
- Returns:
- String client id
-
getClientSecret
public String getClientSecret()
Description copied from interface:OAuth2Context
Get the OAuth 2.0 Client Secret- Specified by:
getClientSecret
in interfaceOAuth2Context
- Returns:
- String encrypted client secret
-
getAuthorizationTokenUrl
public String getAuthorizationTokenUrl()
Description copied from interface:OAuth2Context
Get the OAuth 2.0 Authorization Token URL The authorization token url is used retrieve the authorization code.- Specified by:
getAuthorizationTokenUrl
in interfaceOAuth2Context
- Returns:
- String authorization token url
-
getAccessTokenUrl
public String getAccessTokenUrl()
Description copied from interface:OAuth2Context
Get the OAuth 2.0 Access Token URL The Access Token URL is used when retrieving new access and refresh tokens.- Specified by:
getAccessTokenUrl
in interfaceOAuth2Context
- Returns:
- String access token url
-
isUseRefreshToken
public boolean isUseRefreshToken()
Description copied from interface:OAuth2Context
Indicates if this OAuth 2.0 configuration uses refresh tokens- Specified by:
isUseRefreshToken
in interfaceOAuth2Context
- Returns:
- boolean true if refresh tokens are used.
-
getAuthorizationParameters
public Map<String,String> getAuthorizationParameters()
Description copied from interface:OAuth2Context
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 retrieval- Specified by:
getAuthorizationParameters
in interfaceOAuth2Context
- Returns:
- Map<String, String> parameter name, parameter value
-
getAccessTokenParameters
public Map<String,String> getAccessTokenParameters()
Description copied from interface:OAuth2Context
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 retrieval- Specified by:
getAccessTokenParameters
in interfaceOAuth2Context
- Returns:
- Map<String, String> parameter name, parameter value
-
getScope
public String getScope()
Description copied from interface:OAuth2Context
Get the OAuth 2.0 Access Token scope- Specified by:
getScope
in 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:
getOAuth2Token
in 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:OAuth2Context
Get the claims used to build the JWT assertion.- Specified by:
getJwtAssertionParameters
in interfaceOAuth2Context
- Returns:
- JWT Assertions object.
-
-