Skip to main content
1-Visitor
June 20, 2017
Solved

validateEnabledThingworxUser depricated and alternative does not work same, what was changed?

  • June 20, 2017
  • 4 replies
  • 5412 views

In custom Authentificator, I have this code and it works fine:

Since validateEnabledThingworxUser is depricated in favor of validateThingworxUser, I changed the method.

Now I am getting error:

Authenticator threw an exception while invoking authenticate(...), authenticatorName=WebsealAuth, exception=tried to access method com.thingworx.security.authentication.AuthenticationUtilities.validateThingworxUser(Ljava/lang/String;)Lcom/thingworx/security/users/User; from class

What has changed? Cannot find anything in JavaDoc, how is that even possible when using catch with custom Exception?

Any help would be appriciated? Silvia Balta​ related to our case.

Best answer by jgabriel

Ok with sdk 7.3.1 there is no validateThingworxUser and validateEnabledThingworxUser does not throw deprication and everything works as expected. You should use validateThingworxUser instead of validateEnabledThingworxUser from 7.4.x forward.

I can confirm that problem was caused (on my part) by version missmatch using 7.4.x sdk on 7.3.x Thingworx. Marketplace package did not have version in file name, which resulted in me not checking compatibility...

Tori Tielebein sorry to bother you with that, can we get back to questions above?

4 replies

jgabriel1-VisitorAuthor
1-Visitor
June 20, 2017

Also issueAuthenticationChallenge gets called even if setRequiresChallenge(false); with deprecated validateEnabledThingworxUser.

A bug maybe?

jgabriel1-VisitorAuthor
1-Visitor
June 22, 2017

this.setRequiresChallenge(false) does not seem to make any difference. I would like to pass to next Authentificator without needing to enter issueAuthenticationChallenge and throwing seccond exception.  Is it possible?

Also new method mentioned above throws exception I can not catch with this code snippet, any ideas? (Have to stay with depricated for now?)

Maybe Tori Tielebein​ would know?

Regards JG.

5-Regular Member
June 22, 2017

Can you tell me which version of the Extension SDK you are using? I don't have any issues like this in the older version, but I can test a newer version to verify if there are bugs or not (and it certainly sounds like there may be). You mentioned a case for this, can you tell me the number? I think this issue with "stRequiresChallenge" may need its own case, if it doesn't have one already.

5-Regular Member
June 23, 2017

This is certainly working for me with the 7.2 Extension SDK, as I thought. I will try now in 7.4

5-Regular Member
June 23, 2017

Jan Gabriel​ I'm not sure if my previous comment was sent; what is ThingWorx behavior when you get the "Authenticator threw an exception while invoking authenticate..." error? Does the Composer load? Or is there other behavior?

5-Regular Member
June 28, 2017

So, Jan Gabriel​, what problems or questions remain now that you have resolved the versions?

5-Regular Member
June 30, 2017

There is a bug related to this filed with KCS documentation found here.