{"id":16676048,"url":"https://github.com/marvin255/jwt-symfony","last_synced_at":"2026-04-04T00:04:30.927Z","repository":{"id":43259047,"uuid":"364351736","full_name":"marvin255/jwt-symfony","owner":"marvin255","description":"Symfony bundle for marvin255/jwt lib.","archived":false,"fork":false,"pushed_at":"2025-05-11T14:08:55.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-27T09:23:58.636Z","etag":null,"topics":["jwt","php","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marvin255.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-05-04T18:35:44.000Z","updated_at":"2025-05-11T14:08:34.000Z","dependencies_parsed_at":"2025-08-18T20:32:36.359Z","dependency_job_id":"0503b840-9606-4c58-ad04-67e8ec3fcd0f","html_url":"https://github.com/marvin255/jwt-symfony","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"a8c976de92d11617b0bbe3bcbe75dd0e2d632c3e"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/marvin255/jwt-symfony","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvin255%2Fjwt-symfony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvin255%2Fjwt-symfony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvin255%2Fjwt-symfony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvin255%2Fjwt-symfony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marvin255","download_url":"https://codeload.github.com/marvin255/jwt-symfony/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvin255%2Fjwt-symfony/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31382355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T23:20:52.058Z","status":"ssl_error","status_checked_at":"2026-04-03T23:20:51.675Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jwt","php","symfony","symfony-bundle"],"created_at":"2024-10-12T13:08:54.603Z","updated_at":"2026-04-04T00:04:30.920Z","avatar_url":"https://github.com/marvin255.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JWT\n\n[![Build Status](https://github.com/marvin255/jwt-symfony/workflows/jwt_symfony/badge.svg)](https://github.com/marvin255/jwt-symfony/actions?query=workflow%3A%22jwt_symfony%22)\n\nSymfony bundle for the [marvin255/jwt](https://github.com/marvin255/jwt) library.\n\n\n\n## Installation\n\nInstall the bundle via Composer\n\n```shell\ncomposer req marvin255/jwt-symfony\n```\n\n\n\n## Configuration\n\nSet up one or more profiles in your configuration\n\n```yaml\n# config/packages/marvin255_jwt_symfony.yaml\nmarvin255_jwt_symfony:\n    profiles:\n        basic:\n            signer: RS256                                 # signer algorithm\n            signer_public: 'file:///path/to/public.key'   # path to public key\n            signer_private: 'file:///path/to/private.key' # path to private key\n            signer_private_password: 'password'           # password for private key\n            use_signature_constraint: true                # allow signature validation\n            use_not_before_constraint: true               # allow not before validation\n            not_before_leeway: 2                          # leeway to check nbf header\n            use_expiration_constraint: true               # allow expiration validation\n            expiration_leeway: 2                          # leeway to check exp header\n            use_audience_constraint: true                 # allow audience validation\n            audience: 'test'                              # audience to check\n```\n\n\n\n## Usage\n\n```php\nuse Marvin255\\Jwt\\Symfony\\Profile\\JwtProfileManager;\nuse Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController;\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse RuntimeException;\n\nfinal class SiteController extends AbstractController\n{\n    public function __construct(private JwtProfileManager $jwtProfileManager)\n    {\n    }\n\n    public function read(Request $request): void\n    {\n        // Select profile\n        $jwtProfile = $this-\u003ejwtProfileManager-\u003eprofile('basic');\n\n        $tokenHeader = $request-\u003eheaders-\u003eget('Authorization');\n\n        // Decode the token from the header string\n        $token = $jwtProfile-\u003egetDecoder()-\u003edecodeString($tokenHeader);\n\n        // Validate the token\n        $validationResult = $jwtProfile-\u003egetValidator()-\u003evalidate($token);\n        if (!$validationResult-\u003eisValid()) {\n            $message = implode('. ', $validationResult-\u003egetErrors());\n            throw new RuntimeException($message);\n        }\n    }\n\n    public function build(): void\n    {\n        // Select profile\n        $jwtProfile = $this-\u003ejwtProfileManager-\u003eprofile('basic');\n\n        // Build a token\n        $token = $jwtProfile\n            -\u003egetBuilder()\n            -\u003esetJoseParam('test', 'test') // Any custom JOSE parameter\n            -\u003esetIss('test')               // Registered claims have their own setters\n            -\u003esetClaim('test', 'test')     // Any custom claim\n            -\u003ebuild();\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarvin255%2Fjwt-symfony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarvin255%2Fjwt-symfony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarvin255%2Fjwt-symfony/lists"}