User Authentication on a mobile AngularJS App -


i'd ask question, have more 1 solution @ stage don't know how solve problem.

i'm building mobile application built in angular/ionic accessing woocommerce api, app needs pass consumer key secret in order obtain product information create products.

i assume not have direct access database on phone can store theses details authenticate app , point @ right woocommerce store.

even if store these in server based app, mobile app still needs authenticate server based app in order access correct woocommerce store.

could point me right directions how developers go problem?

usually, mobile authentication in phonegap/ionic looks that:

  1. you send authentication request login/pass or apikey.
  2. server response token.
  3. you store token in localstorage.
  4. send token every apirequest.

here example how pass token every api request if have token.

angular.module('app').config(appconfig); appconfig.$inject = ['$httpprovider']; function appconfig($httpprovider, $sceprovider) {       var token = simplestorage.get('access_token'); // simplestorage here js-plugin using localstorage     if(token){         $httpprovider.defaults.headers.common['access-token'] = token;     } } 

Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -