O'Reilly logo

PhoneGap By Example by Andrey Kovalenko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing authentication on the application side

Now, let's go back to our Cordova/Sencha Touch application. We need to be able to authenticate in the mobile application, receive the token, save it in the application, and use it for all future requests. We already have the login form implemented on the service side. We can utilize it in our mobile application as well.

We can easily handle this task with the InAppBrowser Cordova plugin. This plugin provides a web browser view that displays when calling window.open(). Let's install the plugin:

$ cordova plugin add org.apache.cordova.inappbrowser

Now, let's define the UI from where we can invoke InAppBrowser. We can do this in app/view/Main.js. We will create the additional Settings tab panel: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required