77

Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 2: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 3: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 4: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Architecte technique chez

depuis 2011

+5 ans d’expérience sur une quinzaine de

projets Symfony2 de tous types

Page 5: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

1

Page 6: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 7: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Une API Web :

expose de l’information potentiellement critique

permet de manipuler cette information

Page 8: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Une API Web :

expose de l’information potentiellement critique

permet de manipuler cette information

Edition Ajout Suppression

Page 9: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 10: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 11: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

CRUCIAL de veiller à une

sécurité accrue de chaque API

Page 12: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Une API Web :

expose de l’information potentiellement critique

permet de manipuler cette information

est normalement stateless Pas de session Appel isolé

Page 13: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Une API Web :

expose de l’information potentiellement critique

permet de manipuler cette information

est normalement stateless Pas de session Appel isolé

Page 14: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Une API Web :

expose de l’information potentiellement critique

permet de manipuler cette information

est normalement stateless Pas de session Appel isolé Authentification à chaque appel

Page 15: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Une API Web :

expose de l’information potentiellement critique

permet de manipuler cette information

est normalement stateless

doit être utilisée en HTTPS

Page 16: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 17: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Authentification basée sur la session

Page 18: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Inconvénients

CORS (Cross-origin resource sharing)

Évolutivité

Page 19: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Authentification basée sur les clefs d’API

Pas de session

Page 20: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Authentification basée sur les clefs d’API

Pas de session

Gestion des clefs en bdd

1 andre … z654df84sSdDLfs3

2 amine … Ohg2v5x6df2fFspoa1fdffds8

3 antoine … khHp5se8w2xf1t9823tz3

Page 21: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Authentification basée sur les clefs d’API

Pas de session

Gestion des clefs en bdd

Pas de mécanisme d’expiration

Page 22: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Authentification basée sur les clefs d’API

Pas de session

Gestion des clefs en bdd

Pas de mécanisme d’expiration

Token non exploitable

Page 23: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Solution idéale :

Stateless

Gestion de l’expiration

Auto-porteuse et sécurisée

Page 24: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

2

Page 25: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 26: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Standard industriel qui repose sur une RFC (7519)

Permet de fournir un mécanisme d’authentification fiable

Repose sur un token qui va contenir les données

Token sécurisé

o JWS (RFC 7515)

o JWE (RFC 7516)

Fournit un système d’expiration

Page 27: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 28: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 29: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 30: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 31: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Liste des propriétés réservées :

Nom: subDescription: Subject

Nom: expDescription: Expiration Time

Nom: nbfDescription: Not Before

Nom: audDescription: Audience

Nom: issDescription: Issuer

Nom: iatDescription: Issued At

Nom: jtiDescription: JWT ID

Page 32: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 33: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

JOSE : Javascript Object Signing and Encryption

HMAC + SHA RSA + SHA ECDSA + SHA

Page 34: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 35: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Implémentation disponible pour la grande majorité des langages de développement

Page 36: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 37: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 38: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Etape 1 :

L’utilisateur va s’authentifier sur l’API

En cas d’authentification réussie, le serveur génère et renvoie un token JWT à l’application

Page 39: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Etape 2 à N :

L’application transmet le token JWT pour chaque transaction suivante en header des requêtes

Page 40: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 41: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Quelle durée choisir ?

Pas de durée type

En moyenne : entre 5 min et 1 heure

Délai expiré :

Page 42: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

Utilisation de Refresh token

Page 43: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 44: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 45: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

3

Page 46: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 47: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

namespace Symfony\Component\Security\Guard;

abstract class AbstractGuardAuthenticator

{

public function createAuthenticatedToken(UserInterface $user, $providerKey);

}

Page 48: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

namespace Symfony\Component\Security\Guard;

abstract class AbstractGuardAuthenticator implements GuardAuthenticatorInterface

{

public function createAuthenticatedToken(UserInterface $user, $providerKey);

}

Page 49: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

namespace Symfony\Component\Security\Guard;

interface GuardAuthenticatorInterface

{

public function getCredentials(Request $request);

public function getUser($credentials, UserProviderInterface $userProvider);

public function checkCredentials($credentials, UserInterface $user);

public function createAuthenticatedToken(UserInterface $user, $providerKey);

public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey);

public function onAuthenticationFailure(Request $request, AuthenticationException $exception);

public function supportsRememberMe();

}

Page 50: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

namespace Symfony\Component\Security\Guard;

interface GuardAuthenticatorInterface extends AuthenticationEntryPointInterface

{

public function getCredentials(Request $request);

public function getUser($credentials, UserProviderInterface $userProvider);

public function checkCredentials($credentials, UserInterface $user);

public function createAuthenticatedToken(UserInterface $user, $providerKey);

public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey);

public function onAuthenticationFailure(Request $request, AuthenticationException $exception);

public function supportsRememberMe();

}

Page 51: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

namespace Symfony\Component\Security\Http\EntryPoint;

interface AuthenticationEntryPointInterface

{

public function start(Request $request, AuthenticationException $authException = null);

}

Page 52: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 53: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

#app/config/security.yml

security:

encoders:

Symfony\Component\Security\Core\User\UserInterface: plaintext

providers:

in_memory:

memory:

users:

andre:

password: I_<3_Webnet

roles: ROLE_ADMIN

Page 54: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

#app/config/security.yml

security:

firewalls:

login:

pattern: ^/api/login

stateless: true

anonymous: true

provider: in_memory

form_login:

check_path: /api/login_check

success_handler: webnet_authentication.handler.authentication_success

failure_handler: webnet_authentication.handler.authentication_failure

require_previous_session: false

use_referer: true

access_control:

- { path: ^/api/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }

Page 55: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

# app/config/service.yml

services:

webnet_authentication.handler.authentication_success:

class: AppBundle\Security\AuthenticationSuccessHandler

arguments: []

webnet_authentication.handler.authentication_failure:

class: AppBundle\Security\AuthenticationFailureHandler

arguments: []

Page 56: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 57: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

/**

* Class AuthenticationFailureHandler

*

* @package AppBundle\Security

*/

class AuthenticationFailureHandler implements AuthenticationFailureHandlerInterface

{

/**

* {@inheritdoc}

*/

public function onAuthenticationFailure(Request $request, AuthenticationException $exception)

{

$data = array(

'message' => strtr($exception->getMessageKey(), $exception->getMessageData())

);

return new JsonResponse($data, Response::HTTP_FORBIDDEN);

}

}

Page 58: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 59: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

/**

* Class AuthenticationSuccessHandler

*

* @package AppBundle\Security

*/

class AuthenticationSuccessHandler implements AuthenticationSuccessHandlerInterface

{

/**

* @inheritdoc

*/

public function onAuthenticationSuccess(Request $request, TokenInterface $token)

{

return $this->handleAuthenticationSuccess($token->getUser());

}

}

Page 60: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 61: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 62: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

/**

* Class AuthenticationSuccessHandler

* @package AppBundle\Security

*/

class AuthenticationSuccessHandler implements AuthenticationSuccessHandlerInterface

{

const SSL_KEY_PASSPHRASE = 'tests';

public function onAuthenticationSuccess(Request $request, TokenInterface $token)

{

return $this->handleAuthenticationSuccess($token->getUser());

}

public function handleAuthenticationSuccess(UserInterface $user)

{

$jws = new SimpleJWS(array('alg' => 'RS256'));

$jws->setPayload(array('sub' => $user->getUsername(), 'exp' => time() + 3600));

$privateKey = openssl_pkey_get_private("file://path_to_private.key", self::SSL_KEY_PASSPHRASE);

$jws->sign($privateKey);

return new JsonResponse(array('token' => $jws->getTokenString()));

}

}

Page 63: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 64: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 65: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

# app/config/services.yml

services:

app.token_authenticator:

class: AppBundle\Security\WebnetTokenAuthenticator

Page 66: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

/**

* Class WebnetAuthenticator

*

* @package AppBundle\Security

*/

class WebnetAuthenticator extends AbstractGuardAuthenticator

{

}

Page 67: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

/**

* Class WebnetAuthenticator

*

* @package AppBundle\Security

*/

class WebnetAuthenticator extends AbstractGuardAuthenticator

{

/**

* @inheritdoc

*/

public function getCredentials(Request $request)

{

if (!$tokenValue = $request->headers->get('Authorization')) {

// no token? Return null and no other methods will be called

return;

}

$token = explode(' ', $tokenValue);

try {

return ['token' => SimpleJWS::load($token[1])];

} catch (\Exception $e) {

return;

}

}

}

Page 68: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

/**

* Class WebnetAuthenticator

*

* @package AppBundle\Security

*/

class WebnetAuthenticator extends AbstractGuardAuthenticator

{

/**

* @inheritdoc

*/

public function start(Request $request, AuthenticationException $authException = null)

{

$data = array('message' => 'Authentication Required');

return new JsonResponse($data, Response::HTTP_UNAUTHORIZED);

}

}

Page 69: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

/**

* Class WebnetAuthenticator

*

* @package AppBundle\Security

*/

class WebnetAuthenticator extends AbstractGuardAuthenticator

{

/**

* @inheritdoc

*/

public function getCredentials(Request $request)

{

if (!$tokenValue = $request->headers->get('Authorization')) {

// no token? Return null and no other methods will be called

return;

}

$token = explode(' ', $tokenValue);

try {

return ['token' => SimpleJWS::load($token[1])];

} catch (\Exception $e) {

return;

}

}

}

Page 70: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

/**

* Class WebnetAuthenticator

*

* @package AppBundle\Security

*/

class WebnetAuthenticator extends AbstractGuardAuthenticator

{

/**

* @inheritdoc

*/

public function getUser($credentials, UserProviderInterface $userProvider)

{

$payload = $credentials['token']->getPayload();

if (!isset($payload['sub']) || !$payload['sub']) {

return;

}

return $userProvider->loadUserByUsername($payload['sub']);

}

}

Page 71: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

/**

* Class WebnetAuthenticator

*

* @package AppBundle\Security

*/

class WebnetAuthenticator extends AbstractGuardAuthenticator

{

/**

* @inheritdoc

*/

public function checkCredentials($credentials, UserInterface $user)

{

$publicKey = openssl_pkey_get_public("file://path_to_public.key");

// verify that the token is valid (exp) and had the same values

return $credentials['token']->isValid($publicKey, 'RS256');

}

}

Page 72: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

/**

* Class WebnetAuthenticator

*

* @package AppBundle\Security

*/

class WebnetAuthenticator extends AbstractGuardAuthenticator

{

/**

* @inheritdoc

*/

public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)

{

// on success, let the request continue

return null;

}

/**

* @inheritdoc

*/

public function onAuthenticationFailure(Request $request, AuthenticationException $exception)

{

$data = array(

'message' => strtr($exception->getMessageKey(), $exception->getMessageData())

);

return new JsonResponse($data, Response::HTTP_FORBIDDEN);

}

}

Page 73: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

/**

* Class WebnetAuthenticator

*

* @package AppBundle\Security

*/

class WebnetAuthenticator extends AbstractGuardAuthenticator

{

public function supportsRememberMe()

{

return false;

}

}

Page 74: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 75: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement

« There’s a bundle for that ! »

o lexik/LexikJWTAuthenticationBundle

o gesdinet/JWTRefreshTokenBundle (refresh token)

Page 76: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement
Page 77: Présentation PowerPoint › wp-content › uploads › 2017 › 03 › 2017... · 2017-12-01 · projets Symfony2 de tous types. 1. Une API Web : expose de l’information potentiellement