2017 © Pedro Peláez
 

project lexik-jwt-authentication-sandbox

Sandbox for the LexikJWTAuthenticationBundle Symfony bundle

image

rch/lexik-jwt-authentication-sandbox

Sandbox for the LexikJWTAuthenticationBundle Symfony bundle

  • Tuesday, November 1, 2016
  • by rch
  • Repository
  • 2 Watchers
  • 1 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

LexikJWTAuthenticationBundle Sandbox

This is a sample application for experimenting/demonstrating features of the powerful LexikJWTAuthenticationBundle bundle which provides authentication through JWT., (*1)

What's inside

Get started

Clone the project:, (*2)

$ git clone https://github.com/chalasr/lexik-jwt-authentication-sandbox
$ cd lexik-jwt-authentication-sandbox
$ git checkout flex

Create the database schema:, (*3)

$ php bin/console doctrine:database:create
$ php bin/console doctrine:schema:update --force

Usage

Run the web server:, (*4)

$ php bin/console server:run

Register a new user:, (*5)

$ curl -X POST http://localhost:8000/register -d _username=johndoe -d _password=test
-> User johndoe successfully created

Get a JWT token:, (*6)

$ curl -X POST -H "Content-Type: application/json" http://localhost:8000/login_check -d '{"username":"johndoe","password":"test"}'
-> { "token": "[TOKEN]" }  

Access a secured route:, (*7)

$ curl -H "Authorization: Bearer [TOKEN]" http://localhost:8000/api
-> Logged in as johndoe

The Versions