Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Sample Silex Based Rest API that uses Json Web Tokens for Authentication

License

Notifications You must be signed in to change notification settings

jgavinray/Silex-JWT-Rest-Php

Repository files navigation

Silex-JWT-Rest-Php

Sample Project:

PHP 5.5+ project that utilizes the Silex Framework. This is a bare bones REST Api that uses JSON Web Tokens for Authentication.

Build Status Code Climate SensioLabsInsight Dependency Status

Getting Started

There are only three basic requirements at the moment to utilize this Demo project. The first is git (https://git-scm.com/), the second is composer (https://getcomposer.org), and the third is PHPUnit (https://phpunit.de). With these three tools the project is relatively easy to get going and exercise. The commands listed below have been tested on Windows, Linux, and OS X terminals.

Step One - Get the source

  $ git clone https://github.com/DaGopherboy/Silex-JWT-Rest-Php.git

Step two - Get into the same directory as the source code

  $ cd Silex-JWT-Rest-Php

Step three - Update all of the dependencies

  $ composer update

Step four - Run the tests

  $ phpunit

Why do this? There are so many other options!

Good question, there are many great frameworks out there that have authentication modules that can make bootstrapping a new api a snap. What I wanted to do was have a very minimalist bootstrap project that I can pull off the shelf and start writing code to prototype something. In addition to that goal, this project has provided a fantastic learning opportunity of how to use JSON Web Tokens (http://jwt.io); And how they can play a part in a security strategy for REST APIs.

Contributions

If you see anything that can be improved upon, and are interested in contributing please feel free to submit a pull request.

About

Sample Silex Based Rest API that uses Json Web Tokens for Authentication

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published