I try to create with angularjs based Ionic app an authentication mechanism. The system looks like this:
mobile users are created by administrators on the server. This created mobile user can login into the app.
The users are stored on the server in a JSON object. I had imagined the steps as following?
- The link to the JSON object should be parsed.
- The created users and passwords on the server are to be compared with the locally login data
- If the user has successfully logged into the system, the user data should be stored locally.
Edit:
The flow of the authentication will be effected as follows:
How to create a login system like this programmatically?
The steps should be
1) Send username password to server using $http.post();
2) Server authenticates the credentials. and returns a token in return is credentials are correct.
3) App stores this token locally and passes it to server for later request as a mean of identification of logged in user.
Ideally you should implement SOAP or REST based services on your server and consume those services in your app.