I've setup a standard ionicframework (with "ionic start myapp tabs"), and i've got a laravel php backend on the other side (which has the database and so on).
Now what I want is to ask the database of my backend from my mobile-app (it'll be a native app, compiled by phonegap). There's problems with CORS to be solved, it seems, and I've read a lot of approaches on how to do it, but none really worked.
What is a good way to authenticate (token based) to my external backend server, and then, once authenticated ask the server API for various things ? Does anyone additionally have a good tutorial and/or working example ?
This is the tutorial may help you how to use token system with angular and node js.Coming to data base you can use mysql.When using token based authentication header should have a valid token on every end point to server.you can your feasible token generators also lik oauth2.
http://code.tutsplus.com/tutorials/token-based-authentication-with-angularjs-nodejs--cms-22543
I made a complete User Authentication example for Ionic an AngularJS. In general, you authenticate on your backend, receive a Token and sign all your future requests with that x-auth-token.
If you receive a response indicating an invalid request, you know it's time to log in again (or refresh your token).
Take a look at: How To Handle User Authentication With AngularJS Inside Your Ionic App