Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
I am developing a mobile app that communicates with TWX via REST API. I have created MobileConnector_TH which having services that pull the data and revert it to mobile via HTTP Rest API.
Problem statement:-
I have one service written in MobileConnector_TH - validateUser(Username, Password)
Which contains the following code
var params = {
url: me.IPUrl+"/Thingworx/action-login?OrganizationName="+organization+"&thingworx-form-userid="+username+"&thingworx-form-password="+password+"&x-thingworx-session=true" /* STRING */,
contentType: "text/html" /* STRING */
};
// result: STRING
var result = Resources["ContentLoaderFunctions"].GetText(params);
This returns HTML webpage data into a string. I am unable to find any specific scenario to validate username&Password via Service. It showing the same result with the wrong password/username.
@sushantpatekar , Not quite sure that I can address all of your questions. I have used a couple of different REST API calls to get information on the users in the system.
To get a list of the users defined in the system. For my testing I used POSTMAN. The first question I tried to answer was can I get a list of the users on the system. To do this requires that I have an AppKey, you only do not want to share information with just anyone.
Second question now that I know a user name can I get information about that user
In your post you are trying to make a REST API call and perform a login. Try the following.
Now an item to be considered this approach is sending a username and password as clear text between a device and a server. NOT good security
Let me know if this helps
Peter