Ionic rest api authentication

Hi, guys. I have a Rails API on Heroku. I want to create a login page in my ionic version 3 app using api. The body of “post” method includes email and password. The server responds with authentication_token which I should use for authorization of some methods.

Where I should store authentication_token?

So, what would you suggest me? Any tutorials.

That depends on whether you want it to persist across app restarts. If so, I would use ionic-storage. If not, I would use a transient service provider.

1 Like

What is the difference between storing auth token in localStorage and ionicStorage?

If you use ionic-storage, you can believe that what you store will persist across app restarts. If you use localStorage, you can’t.

Use the “Storage” that ionic has available. It suppose to search for which ever most secure storage base the client is using and securely store the information there.

Here’s a link:
Good luck!