2

I try to create with angularjs based Ionic app an authentication mechanism. The system looks like this:

enter image description here

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?

  1. The link to the JSON object should be parsed.
  2. The created users and passwords on the server are to be compared with the locally login data
  3. 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:

enter image description here

How to create a login system like this programmatically?

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

maybe you could specify a (pseudo) code example in angularjs?
I don't think that is a great solution since everyone can see the credentials just looking the js code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.