Skip to main content
1-Visitor
November 16, 2017
Question

Username and Password validation

We have separated the presentation layer in angular js and rest of the business logic, data are maintained in TX platform. How to validate when the user enter the username and password from login screen? Is there anyway I can validate the user credentials username and password are matched with the TX system. I'm not able to retrive password stored in TX platform and compare with the user entered.

I am facing difficulty to compare password.. Pl assist.

4 replies

1-Visitor
November 17, 2017

I don't know how to do this in AngularJS, but make a request with HTTP basic authentication on some ThingWorx entity your user should have access to and check which response code you're getting back. If it's 200, then you're good to go.

To not repeat your username and password with every request you should probably utilize ThingWorx application keys, though.

Translate
1-Visitor
November 17, 2017

Appreciate your response. This will workout to validate the username. But what if we pass knowingly invalid password then login test case would fail. So, I'm worried about that.

Translate
1-Visitor
November 18, 2017

I suppose with the wrong password you would get some other response code than 200? 401 probably.

Translate