Login Authorization in Ionic 2 - Help?

Hey all,

I’ve been trying to learn Ionic, Angular and Typescript for a few weeks but can’t see to find a way to setup a simple username and password login system for my app. The company I work for has a web application and I have to create an Ionic app which adds, edits and removes data as you would expect. Problem is that I’ve spent the past week going through a lot of different tutorials on just logging in. I believe I’ve got a good grasp of the user interface building in Ionic, its the Angular and Typescript I’m having trouble with.

I need to log into the server from the app as if I were logging into the web application. I’ve tried piecing together tutorials on login authorization but I’m not getting anywhere. The code used to authenticate all looks very similar but nobody really breaks it down and I can’t get it to work. I believe I need to use the HTTP method post in order to call the REST api but I can’t seem to get it to work. I just need to log into the server only with valid data and then I can figure out the rest. I don’t need to sign up or anything as this is only done on the web application.

Can someone please point me in the right direction? haha


Run the web application in Chrome. Open the “Network” tab of the developer tools. Log in. Look at what is going over the wire. You are going to have to replicate that.