Class NTLMMediator

  • All Implemented Interfaces:
    AspectConfigurable, ManagedLifecycle, Mediator, SynapseArtifact

    public class NTLMMediator
    extends AbstractMediator
    implements ManagedLifecycle
    NTLM Mediator mainly creates an authenticator with the credentials which user provides as parameters. Required authentication params are username, password, host, domain and NTLM version. Created authenticator authenticator is set to the MessageContext as _NTLM_DIGEST_BASIC_AUTHENTICATION_ property (HTTPConstants.AUTHENTICATE).

    Further this Reads the MultiThreadedHttpConnectionManager from the cache and set it to the Axis2MessageContext as MULTITHREAD_HTTP_CONNECTION_MANAGER property.

    After NTLM mediator authenticates properly user can use callout mediator or call mediator with blocking=true to send the payload to backend. In order to persist the authenticator through out the call and callout mediators please use initAxis2ClientOptions="false" parameter in call and callout mediators.

    • Constructor Detail

      • NTLMMediator

        public NTLMMediator()
    • Method Detail

      • mediate

        public boolean mediate​(MessageContext messageContext)
        Description copied from interface: Mediator
        Invokes the mediator passing the current message for mediation. Each mediator performs its mediation action, and returns true if mediation should continue, or false if further mediation should be aborted.
        Specified by:
        mediate in interface Mediator
        Parameters:
        messageContext - the current message for mediation
        Returns:
        true if further mediation should continue
      • init

        public void init​(SynapseEnvironment synapseEnvironment)
        When init have to set the NTLM Custom Authenticator as auth scheme and set jcifs encoding to ASCII.
        Specified by:
        init in interface ManagedLifecycle
        Parameters:
        synapseEnvironment - SynapseEnvironment to be used for initialization
      • destroy

        public void destroy()
        Description copied from interface: ManagedLifecycle
        This method should implement the destroying of the implemented parts of the configuration.
        Specified by:
        destroy in interface ManagedLifecycle
      • getUsername

        public String getUsername()
      • setUsername

        public void setUsername​(String username)
      • getPassword

        public String getPassword()
      • setPassword

        public void setPassword​(String password)
      • getHost

        public String getHost()
      • setHost

        public void setHost​(String host)
      • getDomain

        public String getDomain()
      • setDomain

        public void setDomain​(String domain)
      • getNtlmVersion

        public String getNtlmVersion()
      • setNtlmVersion

        public void setNtlmVersion​(String ntlmVersion)
      • setDynamicUsername

        public void setDynamicUsername​(Value dynamicUsername)
      • setDynamicPassword

        public void setDynamicPassword​(Value dynamicPassword)
      • setDynamicHost

        public void setDynamicHost​(Value dynamicHost)
      • setDynamicDomain

        public void setDynamicDomain​(Value dynamicDomain)
      • setDynamicNtmlVersion

        public void setDynamicNtmlVersion​(Value dynamicNtmlVersion)