Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Latest commit

 

History

History
24 lines (14 loc) · 415 Bytes

get-jwt-payload-of-authenticated-user.md

File metadata and controls

24 lines (14 loc) · 415 Bytes

Get JWT payload of authenticated user

You can get JWT payload of authenticated user via jwt_payload attribute in security token.

Sample:

<?php

namespace App\Services;

use Symfony\Component\Security\Core\Security;

class MyService {

    public function __construct(Security $security) {
        $security->getToken()->getAttribute('jwt_payload');
    }
    
}