Skip to content

ionicthemes/ionic-platform-authentication-for-your-ionic-app

Repository files navigation

How to integrate user authentication to your ionic app

In this tutorial we are going to explain how to add Log in, Log out, and Sign up functionality to your ionic app using the Ionic Platform services.

Setup

Install Ionic

You can find the Ionic official installation documentation here.

  1. Make sure you have an up-to-date version of Node.js installed on your system. If you don't have Node.js installed, you can install it from here.
  2. Open a terminal (Mac) or a command interpreter (cmd, Windows), and install Cordova and Ionic:
    • npm install -g cordova
    • npm install -g ionic
    • On a Mac, you may have to use sudo depending on your system configuration: sudo npm install -g cordova ionic
  3. If you already have Cordova and Ionic installed on your computer, make sure you update to the latest version:
    • npm update -g cordova
    • npm update -g ionic
    • Or sudo npm update -g cordova ionic

Follow these links if you want more information:

Git & ionic start

First we need to link this new Ionic project with our reference repo on github. Clone this repo so we can start working on the app:

  • git clone https://github.com/ionicthemes/ionic-platform-authentication-for-your-ionic-app.git
  • cd ionic-auth

After this, we need to set up some stuff before starting working on the Ionic project. To do so, run these commands:

  • npm install
  • bower install As we are going to use Ionic Platform services, we need to install and init the platform services with this command:
  • ionic add ionic-platform-web-client
  • ionic io init

NOTE: The last step is critical, if we install the ionic-platform-web-client but don't init, then we may find some bugs when serving the app.

Finally, to see the current state of the project, run:

  • ionic serve