2017 © Pedro Peláez
 

project lexik-jwt-authentication-sandbox

Sandbox for the LexikJWTAuthenticationBundle Symfony bundle

image

chalasr/lexik-jwt-authentication-sandbox

Sandbox for the LexikJWTAuthenticationBundle Symfony bundle

  • Tuesday, July 10, 2018
  • by chalasr
  • Repository
  • 7 Watchers
  • 49 Stars
  • 187 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 14 Forks
  • 7 Open issues
  • 10 Versions
  • 9 % 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