public abstract class AbstractOAuthTokenBearerConfig extends AbstractOAuthConfig
Modifier and Type | Field and Description |
---|---|
protected String |
consumerKey |
protected boolean |
disableSessionInvalidation |
protected org.apache.http.impl.client.CloseableHttpClient |
httpclient |
protected String |
keyStore |
protected String |
principal |
protected String |
storePassword |
protected String |
tokenEndpoint |
COULD_NOT_EXTRACT_FIELD
RECOMMENDED_API_VERSION
Constructor and Description |
---|
AbstractOAuthTokenBearerConfig() |
Modifier and Type | Method and Description |
---|---|
protected void |
connect(String consumerKey,
String keyStore,
String storePassword,
String principal,
String tokenEndpoint,
boolean disableSessionInvalidation) |
void |
destroySession()
End the current session
|
protected void |
establishConnection(String grantType,
String consumerKey,
String tokenEndpoint,
String keyStore,
String storePassword) |
protected abstract String |
getGrantType() |
protected InputStream |
getKeyStoreResourceStream(String keyStoreName) |
String |
getPrincipal()
Getter method for principal user.
|
String |
getSessionId()
Getter method for connection identifier.
|
String |
getTokenEndpoint()
Getter method for token endpoint configuration element.
|
protected boolean |
isDisableSessionInvalidationActive() |
protected void |
sendAuthorizationRequestAndParseResponse(String tokenEndpoint,
String grantType,
String jwtToken) |
void |
validateConfiguration(String consumerKey,
String keyStore,
String storePassword,
String principal,
String tokenEndpoint,
boolean disableSessionInvalidation)
Method validating configuration.
|
getApiVersion, getOAuth2AccessToken, getOAuth2instanceId, partnerConnection, postAuthorization, setApiVersion, setOAuth2AccessToken, setOAuth2instanceId
computeBaseUrl, getAllowFieldTruncationSupport, getApexClassNames, getApexClient, getAssignmentRuleId, getBatchSobjectMaxDepth, getBulkConnection, getClearNullFields, getClientId, getConnectionTimeout, getFetchAllApexRestMetadata, getFetchAllApexSoapMetadata, getMetadataConnection, getMuleContext, getPartnerConnection, getProxyHost, getProxyPassword, getProxyPort, getProxyPortAsInteger, getProxyUsername, getPushEventRestClient, getReadTimeout, getTimeObjectStore, getUrls, getUseDefaultRule, getUsername, initConnectionConfig, isConnected, logoutPartnerConnection, setAllowFieldTruncationSupport, setApexClassNames, setAssignmentRuleId, setBatchSobjectMaxDepth, setClearNullFields, setClientId, setConnectionOptions, setConnectionTimeout, setFetchAllApexRestMetadata, setFetchAllApexSoapMetadata, setMuleContext, setPartnerConnection, setProxyHost, setProxyPassword, setProxyPort, setProxyUsername, setReadTimeout, setTimeObjectStore, setUseDefaultRule, setUsername, subscribe, validateApexClassesConfiguration, validateCurrentSession, validatePartnerConnection, validateProxyConfiguration, verifyApiVersion
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
recreateSession
protected String consumerKey
protected String keyStore
protected String storePassword
protected String principal
protected String tokenEndpoint
protected boolean disableSessionInvalidation
protected org.apache.http.impl.client.CloseableHttpClient httpclient
@TestConnectivity(label="Validate Configuration...") public void validateConfiguration(@ConnectionKey String consumerKey, String keyStore, @Password String storePassword, String principal, String tokenEndpoint, boolean disableSessionInvalidation) throws org.mule.api.ConnectionException
consumerKey
- Consumer key for Salesforce connected appkeyStore
- Path to key store used to sign data during authenticationstorePassword
- Password of key storeprincipal
- Username of desired Salesforce user to take action on behalf of.tokenEndpoint
- URL pointing to the server responsible for providing the authentication token. According to Salesforce it should be https://login.salesforce.com/services/oauth2/token, or,
if implementing for a community, https://acme.force.com/customers/services/oauth2/token (where acme.force.com/customers is your community URL).disableSessionInvalidation
- If true then the session will NOT be invalidated when the connection pool deems the connection is no longer needed. This could be useful when you use the same username from
* more applications and get the same session from Salesforce. Default value is false.org.mule.api.ConnectionException
- If something goes wrongprotected void connect(String consumerKey, String keyStore, String storePassword, String principal, String tokenEndpoint, boolean disableSessionInvalidation) throws org.mule.api.ConnectionException
org.mule.api.ConnectionException
protected abstract String getGrantType()
protected void establishConnection(String grantType, String consumerKey, String tokenEndpoint, String keyStore, String storePassword) throws org.mule.api.ConnectionException
org.mule.api.ConnectionException
protected void sendAuthorizationRequestAndParseResponse(String tokenEndpoint, String grantType, String jwtToken) throws IOException
IOException
protected InputStream getKeyStoreResourceStream(String keyStoreName) throws FileNotFoundException
FileNotFoundException
@Disconnect public void destroySession()
destroySession
in class AbstractConfig
protected boolean isDisableSessionInvalidationActive()
isDisableSessionInvalidationActive
in class AbstractConfig
public String getPrincipal()
@Nullable @ConnectionIdentifier public String getSessionId()
getSessionId
in interface SessionControl
getSessionId
in class AbstractOAuthConfig
public String getTokenEndpoint()
Copyright © 2010–2020. All rights reserved.