<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic No applicationContext is set in saml authenticator. in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/no-applicationcontext-is-set-in-saml-authenticator/m-p/133503#M35938</link>
    <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I get the following stacktrace:&lt;/P&gt;&lt;P&gt;&amp;nbsp;java.lang.IllegalStateException: Application Context must be set programatically for Authenticator.&lt;BR /&gt;at org.springframework.extensions.webscripts.connector.AbstractAuthenticator.getConnectorService(AbstractAuthenticator.java:72)&lt;/P&gt;&lt;P&gt;We have slotted in the saml module, version 1.2.2&lt;/P&gt;&lt;P&gt;But the authenticator 'CustomSAMLAlfrescoAuthenticator' has no applicationContext set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The authenticator is constructed in TennantSAMLConnectorService.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When an ordinary Authenticator is constructed, then an applicationContext is set on the Authenticator. See the method ConnectorSevice.buildAuthenticator.&lt;/P&gt;&lt;P&gt;Is this a bug??&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Wybrand.&lt;/P&gt;&lt;P&gt;ConnectorService.buildAuthenticator:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;private &lt;/SPAN&gt;Authenticator buildAuthenticator(String className)&lt;BR /&gt;    &lt;SPAN&gt;throws &lt;/SPAN&gt;ConnectorServiceException&lt;BR /&gt;{&lt;BR /&gt;    Authenticator auth = (Authenticator)ReflectionHelper.&lt;SPAN&gt;newObject&lt;/SPAN&gt;(className);&lt;BR /&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;(auth == &lt;SPAN&gt;null&lt;/SPAN&gt;)&lt;BR /&gt;    {&lt;BR /&gt;        &lt;SPAN&gt;throw new &lt;/SPAN&gt;ConnectorServiceException(&lt;SPAN&gt;"Unable to instantiate Authenticator: " &lt;/SPAN&gt;+ className);&lt;BR /&gt;    }&lt;BR /&gt;    &lt;BR /&gt;    &lt;SPAN&gt;// Set the application context for the Authenticator object&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    // TODO: Authenticators should be Spring beans, but due to legacy config they are constructed from class names&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;(auth &lt;SPAN&gt;instanceof &lt;/SPAN&gt;ApplicationContextAware)&lt;BR /&gt;    {&lt;BR /&gt;        ((ApplicationContextAware)auth).setApplicationContext(&lt;SPAN&gt;applicationContext&lt;/SPAN&gt;);&lt;BR /&gt;    }&lt;BR /&gt;    &lt;BR /&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;auth;&lt;BR /&gt;}&lt;/PRE&gt;</description>
    <pubDate>Mon, 15 Nov 2021 15:07:40 GMT</pubDate>
    <dc:creator>wybrand</dc:creator>
    <dc:date>2021-11-15T15:07:40Z</dc:date>
    <item>
      <title>No applicationContext is set in saml authenticator.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/no-applicationcontext-is-set-in-saml-authenticator/m-p/133503#M35938</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I get the following stacktrace:&lt;/P&gt;&lt;P&gt;&amp;nbsp;java.lang.IllegalStateException: Application Context must be set programatically for Authenticator.&lt;BR /&gt;at org.springframework.extensions.webscripts.connector.AbstractAuthenticator.getConnectorService(AbstractAuthenticator.java:72)&lt;/P&gt;&lt;P&gt;We have slotted in the saml module, version 1.2.2&lt;/P&gt;&lt;P&gt;But the authenticator 'CustomSAMLAlfrescoAuthenticator' has no applicationContext set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The authenticator is constructed in TennantSAMLConnectorService.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When an ordinary Authenticator is constructed, then an applicationContext is set on the Authenticator. See the method ConnectorSevice.buildAuthenticator.&lt;/P&gt;&lt;P&gt;Is this a bug??&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Wybrand.&lt;/P&gt;&lt;P&gt;ConnectorService.buildAuthenticator:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;private &lt;/SPAN&gt;Authenticator buildAuthenticator(String className)&lt;BR /&gt;    &lt;SPAN&gt;throws &lt;/SPAN&gt;ConnectorServiceException&lt;BR /&gt;{&lt;BR /&gt;    Authenticator auth = (Authenticator)ReflectionHelper.&lt;SPAN&gt;newObject&lt;/SPAN&gt;(className);&lt;BR /&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;(auth == &lt;SPAN&gt;null&lt;/SPAN&gt;)&lt;BR /&gt;    {&lt;BR /&gt;        &lt;SPAN&gt;throw new &lt;/SPAN&gt;ConnectorServiceException(&lt;SPAN&gt;"Unable to instantiate Authenticator: " &lt;/SPAN&gt;+ className);&lt;BR /&gt;    }&lt;BR /&gt;    &lt;BR /&gt;    &lt;SPAN&gt;// Set the application context for the Authenticator object&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    // TODO: Authenticators should be Spring beans, but due to legacy config they are constructed from class names&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;(auth &lt;SPAN&gt;instanceof &lt;/SPAN&gt;ApplicationContextAware)&lt;BR /&gt;    {&lt;BR /&gt;        ((ApplicationContextAware)auth).setApplicationContext(&lt;SPAN&gt;applicationContext&lt;/SPAN&gt;);&lt;BR /&gt;    }&lt;BR /&gt;    &lt;BR /&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;auth;&lt;BR /&gt;}&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Nov 2021 15:07:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/no-applicationcontext-is-set-in-saml-authenticator/m-p/133503#M35938</guid>
      <dc:creator>wybrand</dc:creator>
      <dc:date>2021-11-15T15:07:40Z</dc:date>
    </item>
  </channel>
</rss>

