No applicationContext is set in saml authenticator.

cancel
Showing results for 
Search instead for 
Did you mean: 
wybrand
Member II

No applicationContext is set in saml authenticator.

Hi.

I get the following stacktrace:

 java.lang.IllegalStateException: Application Context must be set programatically for Authenticator.
at org.springframework.extensions.webscripts.connector.AbstractAuthenticator.getConnectorService(AbstractAuthenticator.java:72)

We have slotted in the saml module, version 1.2.2

But the authenticator 'CustomSAMLAlfrescoAuthenticator' has no applicationContext set. 

The authenticator is constructed in TennantSAMLConnectorService. 

When an ordinary Authenticator is constructed, then an applicationContext is set on the Authenticator. See the method ConnectorSevice.buildAuthenticator.

Is this a bug??

Greetings,

Wybrand.

 

ConnectorService.buildAuthenticator:

private Authenticator buildAuthenticator(String className)
throws ConnectorServiceException
{
Authenticator auth = (Authenticator)ReflectionHelper.newObject(className);
if (auth == null)
{
throw new ConnectorServiceException("Unable to instantiate Authenticator: " + className);
}

// Set the application context for the Authenticator object
// TODO: Authenticators should be Spring beans, but due to legacy config they are constructed from class names
if (auth instanceof ApplicationContextAware)
{
((ApplicationContextAware)auth).setApplicationContext(applicationContext);
}

return auth;
}