News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gonzalo Ayuso:
Token based authentication with Silex and AngularJS
June 09, 2014 @ 10:33:37

Gonzalo Ayuso has posted a tutorial showing how to use token-based authentication with a Silex-based application through a request from AngularJS.

According to my last post today we're going to create a AngularJS application that uses the Silex Backend that we create previously. The idea of this application is to use it within a Phonegap/Cordova application running in a mobile device.

He includes the code (and markup) you'll need to make the request work. Basically, it uses a standard HTTP service from inside AngularJS to fetch the token and store it in the client's localstorage. The rest of the code does the checking to see if the user is logged in (the token exists) or if it needs to sow the login form. The "logged in" route also displays an alert to the user with the info (pulled from the API) for their user. The full code for the example can be found over on GitHub.

0 comments voice your opinion now!
token authentication silex angularjs tutorial login localstorage

Link: http://gonzalo123.com/2014/06/09/token-based-authentication-with-silex-and-angularjs/

blog comments powered by Disqus

Similar Posts

Jason Fox: Use the Accept Header to Set Your Return Data With Zend Framework 2

Jakub Zalas' Blog: Managing object creation in PHP with the Symfony2 Dependency Injection component

DevShed: Constructing Multi-Line PDF Documents with PHP 5

SitePoint PHP Blog: Understanding Drupal's EntityFieldQuery

DevShed: Developing an Extensible TCP Server with Sockets in PHP


Community Events





Don't see your event here?
Let us know!


deployment community laravel voicesoftheelephpant podcast api framework tips series zendserver symfony interview conference bugfix release code introduction threedevsandamaybe list language

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework