Skip to content

Instantly share code, notes, and snippets.

View edamov's full-sized avatar

Artur Edamov edamov

  • Kharkiv, Ukraine
View GitHub Profile
@edamov
edamov / population.json
Created June 23, 2020 09:53
Результати перепису населення в Харківській області за 2001р.
[
{
"name": "м Ізюм",
"population": "56075"
},
{
"name": "м Куп'янськ",
"population": "32187"
},
{
@edamov
edamov / index.php
Created October 18, 2016 15:52
PHP token-based (JWT) push notifications to APNS via HTTP/2
<?php
require_once 'vendor/autoload.php';
use Jose\Factory\JWKFactory;
use Jose\Factory\JWSFactory;
$key_file = 'key.p8';
$secret = null; // If the key is encrypted, the secret must be set in this variable
$private_key = JWKFactory::createFromKeyFile($key_file, $secret, [

It's still a work in progress...

Intro

As William Durand was recently explaining in his SOS, he "didn't see any other interesting blog post about REST with Symfony recently unfortunately". After spending some long hours to implement an API strongly secured with oAuth, I thought it was time for me to purpose my simple explanation of how to do it.

Ok, you know the bundles

You might have already seen some good explanation of how to easily create a REST API with Symfony2. There are famous really good bundles a.k.a. :