Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
NOTE: The build produces a zip file in AuthenticatorExample->build->distributions folder. This zip file will be required for importing the extension.
2. For the Import Option field, select Extension.
3. Click Browse and choose the zip file in the distributions folder (located in the Eclipse Project's build directory).
4. Click Import to finalize the import.
2. You will now see your CustomizedAuthenticator Authenticator as a option to view/edit.
3. Click Edit or View to see this new Authenticator. You wil notice the priority is 1.
If your import did not get through with the two green checks, you may want to modify your metadata.xml or java code to fix it depending on the error shown in the logs.
Issue | Solution |
JAR Conflict arises between two similar jars | JAR conflicts arise when a similar jar is already present in the Composer database. Try to remove the respective jar resources from the metadata.xml. Add these jars explicitly in twx-lib folder in the project folder inside the workspace directory. Now, build the project and import the extension in ThingWorx Composer once again. |
JAR is missing | Add the respective jar resource in metadata.xml using the ThingWorx->New Jar Resource. Now, build the project and import the extension in ThingWorx Composer once again. |
Minimum Thingworx Version [ 7.2.1] requirements are not met because current version is: 7.1.3 | The version of SDK you have used to build your extension is higher than the version of the ThingWorx Composer you are testing against. You can manually edit the configfiles->metadata.xml file to change the Minimum ThingWorx version to your ThingWorx Composer version. |
Integration can be handled in different methods based on your security needs and architecture. The Authenticator we created works with the demo site we provided in the download.
Let's create the User that we will be processing login attempts.
In the ThingWorx Composer, click the + at the top left of the screen.
Select User in the dropdown.
Set the Project (ie, PTCDefaultProject) and enter the Name for this new user as TwxUser.
Enter the Password for the new user to something easy to remember (ie, 2020Password2021).
Create a helpful logger for authentication attempts.
Create a Thing named AuthenticationStamper to go with the LoginHelper variable in the earlier Java source code. Ensure this new Thing inherits from the RemoteThing
Match the properties for the AuthenticationStamper with the two properties in the below image.
Create a stream for authentication attempts for helpful tracking.
Create a ValueStream named AuthenticationStream and Save the Entity.
In the Properties and Alerts section of the ValueStream, click Manage Bindings.
Setup the binding to match the below configurations. Bind the properties to the AuthenticationStamper Thing.
With a browser, open the TestSite.html web page found in the Demo directory of the download. You should see a login page similar to that as the below image.
Enter the name of the user we created, TwxUser.
Enter the password for the user. We suggested setting this to Password2019.
Congratulations! You've successfully completed the Create An Authentication Extension tutorial, and learned how to:
We recommend the following resources to continue your learning experience:
Capability | Guide |
Build | Application Development Tips & Tricks |
If you have questions, issues, or need additional information, refer to:
Resource | Link |
Community | Developer Community Forum |
Support | Extension Development Guide |