cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Unable to create Authenticator instance in Authenticator

paripirala
1-Newbie

Unable to create Authenticator instance in Authenticator

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

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

8 REPLIES 8

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

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>

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.

From that error message, you should triple check that your Authenticator's className property matches the fully qualified Java class of UAAAuthenticator. Also, triple check that your thingworxsecurityext.jar actually contains the UAAAuthenticator.class file.

Hi Brian,

Attached is the java class. Also the zip file used to import.

Thanks

Pavan

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.

Thank you very much Brian. Fixing the static part has resolved the issue.

Is there a way to troubleshoot this?

In general, if you experience issues you can't figure out, try to be as minimal as possible in your implementation. Even though the logic was simple in your Authenticator, it still had properties and logic that could cause runtime errors. So stripping out as much as possible can help hone in if you have a problem with the extension structure or the java file.

Top Tags