Package org.frankframework.filesystem
Class MsalClientAdapter
java.lang.Object
org.frankframework.http.AbstractHttpSession
org.frankframework.http.AbstractHttpSender
org.frankframework.filesystem.MsalClientAdapter
- All Implemented Interfaces:
com.microsoft.aad.msal4j.IHttpClient
,CanUseSharedResource<HttpSession>
,FrankElement
,HasApplicationContext
,HasName
,HasPhysicalDestination
,IConfigurable
,IScopeProvider
,ISender
,ISenderWithParameters
,IWithParameters
,NameAware
,HasKeystore
,HasTruststore
,ConfigurableLifecycle
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.context.Lifecycle
,org.springframework.context.Phased
,org.springframework.context.SmartLifecycle
@Protected
public class MsalClientAdapter
extends AbstractHttpSender
implements com.microsoft.aad.msal4j.IHttpClient
This class ensures that Microsoft Authentication Library (MSAL) requests are sent through the configured proxy and the correct SSLSocketFactory.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Silly wrapper to create a clean SDKNested classes/interfaces inherited from class org.frankframework.http.AbstractHttpSender
AbstractHttpSender.HttpMethod
Nested classes/interfaces inherited from class org.frankframework.http.AbstractHttpSession
AbstractHttpSession.OauthAuthenticationMethod
-
Field Summary
Fields inherited from class org.frankframework.http.AbstractHttpSender
CORRELATION_ID_HEADER, headerParamsSet, MESSAGE_ID_HEADER, parametersToSkipWhenEmptySet, paramList, requestOrBodyParamsSet, staticUri, urlParameter
Fields inherited from class org.frankframework.http.AbstractHttpSession
AUTHENTICATION_METHOD_KEY, log
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Configure this component.createGraphClient
(String tenantId, CredentialFactory credentials) protected Message
extractResult
(HttpResponseHandler responseHandler, PipeLineSession session) Custom implementation to extract the response and format it to a String result.protected String
protected org.apache.http.client.methods.HttpRequestBase
getMethod
(URI uri, Message message, ParameterValueList parameters, PipeLineSession session) Custom implementation to create aHttpRequest
object.com.microsoft.aad.msal4j.IHttpResponse
send
(com.microsoft.aad.msal4j.HttpRequest httpRequest) void
start()
This method will be called to start the sender.void
stop()
Stop/close the sender and deallocate resources.Methods inherited from class org.frankframework.http.AbstractHttpSender
addParameter, appendParameters, getLogPrefix, getObjectType, getParameterList, getPhysicalDestinationName, sendMessage, setCharSet, setContentType, setHeadersParams, setMethodType, setParametersToSkipWhenEmpty, setResultStatusCodeSessionKey, setStyleSheetName, setUrl, setUrlParam, setXhtml, validateResponseCode
Methods inherited from class org.frankframework.http.AbstractHttpSession
areCookiesDisabled, execute, getCredentials, getSSLConnectionSocketFactory, getURI, isRunning, setAllowSelfSignedCertificates, setAuthAlias, setAuthDomain, setAuthenticatedTokenRequest, setClientAlias, setClientId, setClientSecret, setConnectionIdleTimeout, setConnectionTimeToLive, setDisableCookies, setFollowRedirects, setHttpClient, setHttpContext, setIgnoreCertificateExpiredException, setIgnoreRedirects, setKeyManagerAlgorithm, setKeystore, setKeystoreAlias, setKeystoreAliasAuthAlias, setKeystoreAliasPassword, setKeystoreAuthAlias, setKeystorePassword, setKeystoreType, setMaxConnections, setMaxExecuteRetries, setOauthAuthenticationMethod, setPassword, setPrefillProxyAuthCache, setProtocol, setProxyAuthAlias, setProxyHost, setProxyPassword, setProxyPort, setProxyRealm, setProxyUsername, setSamlAssertionExpiry, setSamlAudience, setSamlIssuer, setSamlNameId, setScope, setStaleChecking, setStaleTimeout, setSupportedCipherSuites, setTimeout, setTokenEndpoint, setTokenExpiry, setTrustManagerAlgorithm, setTruststore, setTruststoreAuthAlias, setTruststorePassword, setTruststoreType, setUsername, setVerifyHostname
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
Methods inherited from interface org.frankframework.core.CanUseSharedResource
getSharedResource, setSharedResourceRef
Methods inherited from interface org.frankframework.lifecycle.ConfigurableLifecycle
getPhase, isAutoStartup
Methods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoader
Methods inherited from interface org.frankframework.encryption.HasKeystore
getKeyManagerAlgorithm, getKeystore, getKeystoreAlias, getKeystoreAliasAuthAlias, getKeystoreAliasPassword, getKeystoreAuthAlias, getKeystorePassword, getKeystoreType
Methods inherited from interface org.frankframework.core.HasPhysicalDestination
getDomain
Methods inherited from interface org.frankframework.encryption.HasTruststore
getTrustManagerAlgorithm, getTruststore, getTruststoreAuthAlias, getTruststorePassword, getTruststoreType, isAllowSelfSignedCertificates, isIgnoreCertificateExpiredException, isVerifyHostname
Methods inherited from interface org.frankframework.core.ISender
isSynchronous, sendMessageOrThrow
Methods inherited from interface org.frankframework.core.ISenderWithParameters
consumesSessionVariable
Methods inherited from interface org.springframework.context.Lifecycle
isRunning
Methods inherited from interface org.springframework.context.SmartLifecycle
stop
-
Constructor Details
-
MsalClientAdapter
public MsalClientAdapter()
-
-
Method Details
-
configure
Description copied from interface:IConfigurable
Configure this component.configure()
is called once at startup of the framework in the configure method of the owner of thisIConfigurable
. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in theconfigure()
, to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configure
in interfaceIConfigurable
- Overrides:
configure
in classAbstractHttpSender
- Throws:
ConfigurationException
- in case it was not able to configure the component.
-
start
public void start()Description copied from interface:ISender
This method will be called to start the sender. After this method is called the sendMessage method may be called. Purpose of this method is to reduce creating connections to databases etc. in thesendMessage()
method.- Specified by:
start
in interfaceISender
- Specified by:
start
in interfaceorg.springframework.context.Lifecycle
- Overrides:
start
in classAbstractHttpSender
-
stop
public void stop()Description copied from interface:ISender
Stop/close the sender and deallocate resources.- Specified by:
stop
in interfaceISender
- Specified by:
stop
in interfaceorg.springframework.context.Lifecycle
- Overrides:
stop
in classAbstractHttpSender
-
createGraphClient
public MsalClientAdapter.GraphClient createGraphClient(String tenantId, CredentialFactory credentials) throws IOException - Throws:
IOException
-
getAuthenticationToken
- Throws:
IOException
-
send
public com.microsoft.aad.msal4j.IHttpResponse send(com.microsoft.aad.msal4j.HttpRequest httpRequest) throws Exception - Specified by:
send
in interfacecom.microsoft.aad.msal4j.IHttpClient
- Throws:
Exception
-
getMethod
protected org.apache.http.client.methods.HttpRequestBase getMethod(URI uri, Message message, @Nonnull ParameterValueList parameters, PipeLineSession session) throws SenderException Description copied from class:AbstractHttpSender
Custom implementation to create aHttpRequest
object.- Specified by:
getMethod
in classAbstractHttpSender
- Parameters:
uri
- endpoint to send the message tomessage
- to be sentparameters
- ParameterValueList that contains all the senders parameterssession
- PipeLineSession to retrieve or store data from, or NULL when not set- Returns:
- a
HttpRequest
object - Throws:
SenderException
-
extractResult
Description copied from class:AbstractHttpSender
Custom implementation to extract the response and format it to a String result.
It is important that theresponse
will be read or will beclosed
.- Specified by:
extractResult
in classAbstractHttpSender
- Parameters:
responseHandler
-HttpResponseHandler
that contains the response informationsession
-PipeLineSession
which may be null- Returns:
- a string that will be passed to the pipeline
-