Tuesday, April 7, 2015

Authenticator is not instantiated via the properties constructor

I am triggering a SOAP request from SOAP UI to a custom gateway of cordys environment which accepts user credentials in SOAP header.

For Ex :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:oas="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:ns="http://corp.alahli.com/middlewareservices/header/1.0/" xmlns:ns1="http://corp.alahli.com/middlewareservices/test/1.0/">
<!-- Main SOAP Request which is connected to service group SG1-->

Content which is shown in green color is the security information which I am passing from SOAP UI. I hope people are well aware what ${#Project#username} stands for (i.e., I am reading credentials from properties of SOAP Project).

Let's say the request is targeted to service group SG1 in this case. 

As we know that any cordys service is served using SAMLArt. In this case the SAMLArt will be provided by the custom gateway to the application container. Now when the custom gateway tries to get the SAMLArt it uses the property of the application container. If it does not find the property it might throw you an error which was my case.

I encountered an exception which says something like this,

com.eibus.security.authentication.InvalidAuthenticatorException: Authenticator is not instantiated through the properties constructor.
at com.eibus.security.authentication.AuthenticatorFactory.getAuthenticator(AuthenticatorFactory.java:78)
at com.eibus.security.identity.WSSecurityUsernameTokenIdentityType.validate(WSSecurityUsernameTokenIdentityType.java:64)
at com.eibus.soap.SOAPTransaction.<init>(SOAPTransaction.java:349)
at com.eibus.soap.SOAPTransaction.<init>(SOAPTransaction.java:175)
at com.eibus.soap.Processor.onReceive(Processor.java:970)
at com.eibus.soap.Processor.onReceive(Processor.java:943)
at com.eibus.connector.nom.Connector.onReceive(Connector.java:417)
at com.eibus.transport.Middleware$NonTransactionalWorkerThreadBody.run(Middleware.java:1758)
at com.eibus.util.threadpool.WorkerThread.run(WorkerThread.java:64)

Now I found out the property that was missing i.e., the authenticator class. We need to add the authenticator property to the service group that was implementing my service. This should be done by using LDAP explorer,

The property which is to be added is below,

<authenticator implementation="com.eibus.security.authentication.CARSAuthenticator" /> 

Since I am using CARSAuthenticator in my case. This should be added to the service group SG1 (in the above explained scenario). An example of such updation can be found below,


No comments:

Post a Comment