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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Can one validate users via the REST API?

davidc11
1-Visitor

Can one validate users via the REST API?

Is there an appkey-based REST API that will accept user credentials (username/password) and essentially return a boolean (valid/not-valid)?






6 REPLIES 6
Aanjan
12-Amethyst
(To:davidc11)

Hi David,

Currently we do not have a best practice method for
this specific call. If this is a requirement, please do create a support
ticket (or I can create one for you if needed) and we can add the
functionality in one of the forthcoming releases.

-
Aanjan



OK, then, is there a REST API to "login" (passing username & password)?

The form-based login is sorta like this (POSTing form data rather than the exact twx rest syntax), but I haven't gotten it to work (see separate community post on 2/2/15 which no one ever replied to)


Thanks,

-Dave



paic
12-Amethyst
(To:davidc11)

Hi David! Hope all is well.

Sorry nobody replied to your previous post.
However take a look at Support/FAQ in the section Security/Login/Logout you should find your answer there I believe.

I found that item in the FAQ, and tried both the suggest URLs:


http://localhost:8080/Thingworx/Things/NameOfThing/Properties?userid=Administrator&password=admin&x-thingworx-session=true


http://localhost:8080/Thingworx/Things/NameOfThing/Properties?method=get&userid=Administrator&password=admin&x-thingworx-session=true



with a valid server, userid, password, but the server always returns a 404 with page content saying 

"Entity Not Found : "


Could you try the URL against your server and see if you can get it to work, and if you need to adjust the URL syntax please post the syntax you got to work?



smanley
14-Alexandrite
(To:davidc11)

in place of "NameOfThing" you are supposed to replace this with the name of the entity you are trying to access. 

Aanjan
12-Amethyst
(To:davidc11)

Hi David,

Please make sure whether your Tomcat instance is running on port 80 or 8080 and modify the REST call based on that. Also, NameOfThing represents the actual name of the Thing you are trying to access. For example, I have an Edge thing called MyEdgeThing, so in order to access it's properties, I'd use the following call:

http://localhost/Thingworx/Things/MyEdgeThing/Properties?userid=Administrator&password=admin&x-thingworx-session=true



Announcements


Top Tags