Skip to main content
1-Visitor
April 6, 2016
Solved

Unable to create Authenticator instance in Authenticator

  • April 6, 2016
  • 1 reply
  • 3926 views

Hi,

I am unable to import an extension. I am seeing this message in logs

Unable to create Authenticator instance in Authenticator

Any pointers appreciated

Thanks

Pavan

Best answer by brue

Got it. Thank you!

At first it looked like you were getting a ClassDefNotFound exception, but digging deeper it was actually an initialization error. Your Date format is not valid so when the UAAAuthenticator class was being initialized, that static piece was blowing up on you. Fix the format and it should import. Your extension is built properly, it's just the code that has issues.

1 reply

1-Visitor
April 6, 2016

Authenticators are somewhat of a special entity with special treatment. It would be very helpful if you can provide more detail of your problem.

1-Visitor
April 6, 2016

Thanks Brian for the response.

Here are the details:

Environment:

==============

ThingWorx version: 7.0.0

OS: Ubuntu (x86_64 x86_64 x86_64 GNU/Linux)

Tomcat version: 8.0.24

Postgres version: 9.4

Extension details:

==============

We created a java extension for authenticator using the eclipse plugin.

The java class, as part of this extension, extends com.thingworx.security.authentication.CustomAuthenticator

The authenticate method just redirects the user to our SSO. This is only minimal code. We will add more code if the authenticator is successfully imported.

Below is the metadata.xml file. Made sure the class name, package name, jar file name exactly match.

Please let me know if you need any other information.

Thanks

Pavan

<Entities>

    <ExtensionPackages>

        <ExtensionPackage name="ge_uaa_authenticator"

   description="Authentication against UAA"

   vendor="GEIP"

   packageVersion="1.0.0"

   minimumThingWorxVersion="6.5.0">

      <JarResources>

        <FileResource type="JAR" file="thingworxsecurityext.jar" description="GE UAA Authenticator extension JAR file" />

      </JarResources>

    </ExtensionPackage>

    </ExtensionPackages>

    <Authenticators>

        <Authenticator name="UAAAuthenticator"

            className="com.ge.bm.ext.security.UAAAuthenticator"

            description="Authenticator that connects to GE UAA"

            aspect.isEditableExtensionObject="true">

    </Authenticator>

    </Authenticators>

</Entities>

1-Visitor
April 6, 2016

Not sure if you can share your Java based Authenticator, but that would be helpful too.

Here are some general tips to keep in mind with custom Authenticators:

  • Authenticators require you to add a servlet-api jar to your extension project for compilation only. You can copy a servlet-api.jar file into the twx-libs folder of your project(it is hidden inside Eclipse so use a file browser to do this). This jar is provided by tomcat at runtime.
  • Make sure to set aspect.isEditableExtensionObject="true" in metadata.xml so you can edit the entity after you import.
  • The enabled property is overridden on import so it doesn't interfere with the currently configured authenticator.