GithubHelp home page GithubHelp logo

zecho / symfony2-secured-rest-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jshiherlis/symfony2-secured-rest-api

0.0 2.0 0.0 580 KB

Symfony2 Rest Api secured with Json Web Token

License: MIT License

ApacheConf 5.64% PHP 94.36%

symfony2-secured-rest-api's Introduction

Symfony2 Secured REST API

Symfony2 Rest Api secured with Json Web Token

SensioLabsInsight

This project is a secured Restful API template for Symfony2 using lexik/LexikJWTAuthenticationBundle FriendsOfSymfony/FOSRestBundle and FriendsOfSymfony/FOSUserBundle

Create your REST API in 5 minutes

  1. Clone or fork this repository bash $ git clone https://github.com/unautreweb/symfony2-secured-rest-api.git

  2. Install vendors with Composer: bash $ composer update

  3. Generate the SSH keys :

    $ openssl genrsa -out app/var/jwt/private.pem -aes256 4096
    $ openssl rsa -pubout -in app/var/jwt/private.pem -out app/var/jwt/public.pem
  4. Configure the SSH keys path in your config.yml :

    lexik_jwt_authentication:
        private_key_path: %kernel.root_dir%/var/jwt/private.pem   # ssh private key path
        public_key_path:  %kernel.root_dir%/var/jwt/public.pem    # ssh public key path
        pass_phrase:      ''                                      # ssh key pass phrase
        token_ttl:        86400                                   # token ttl - defaults to 86400

Demonstration

Here is an example of the API rest.unautreweb.net:

Testing

Setup the test suite using Composer:

$ composer install --dev

Run it using PHPUnit:

$ vendor/bin/phpunit

Credits

License

This project is under the MIT license. See the complete license in the bundle:

LICENSE

symfony2-secured-rest-api's People

Watchers

Yanko Simeonoff avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.