{"id":23059930,"url":"https://github.com/ciricihq/ciricijwtclientbundle","last_synced_at":"2025-06-14T05:32:42.846Z","repository":{"id":56953012,"uuid":"59836377","full_name":"ciricihq/CiriciJWTClientBundle","owner":"ciricihq","description":"Login against a JWT server or check the validity of a JWT Token","archived":false,"fork":false,"pushed_at":"2018-09-26T16:42:51.000Z","size":89,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-23T23:04:17.703Z","etag":null,"topics":["jwt","jwt-server","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ciricihq.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"Security/ApiUser.php","support":null}},"created_at":"2016-05-27T13:29:36.000Z","updated_at":"2018-09-26T16:48:33.000Z","dependencies_parsed_at":"2022-08-21T04:10:16.536Z","dependency_job_id":null,"html_url":"https://github.com/ciricihq/CiriciJWTClientBundle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciricihq%2FCiriciJWTClientBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciricihq%2FCiriciJWTClientBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciricihq%2FCiriciJWTClientBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciricihq%2FCiriciJWTClientBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ciricihq","download_url":"https://codeload.github.com/ciricihq/CiriciJWTClientBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229901666,"owners_count":18141740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","jwt-server","symfony","symfony-bundle"],"created_at":"2024-12-16T03:10:51.517Z","updated_at":"2024-12-16T03:10:52.385Z","avatar_url":"https://github.com/ciricihq.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"CiriciJWTClientBundle\n=====================\n\n[![Build status][build svg]][build status]\n[![Code coverage][coverage svg]][coverage]\n[![License][license svg]][license]\n[![Latest stable version][releases svg]][releases]\n[![Total downloads][downloads svg]][downloads]\n[![Code climate][climate svg]][climate]\n\nThis Bundle is used to login against a JWT server or to check the validity of a JWT Token\n\nIt has been based on [these instructions][instructions].\n\nWARNING! This bundle is Work In Progress and is not ready for production yet\n\n## Installation\n\n```bash\ncomposer require ciricihq/jwt-client-bundle:dev-master\n```\n\nThen add to `AppKernel.php`\n\n```php\n        $bundles = [\n            ...\n            new Cirici\\JWTClientBundle\\CiriciJWTClientBundle(),\n            ...\n        ];\n```\n\n## Configuration\n\nIf you are planning to use the bundle as a Authentication service against a JWT server,\nyou should load the external token authenticator adding this to your `config.yml`\n\n```yaml\ncirici_jwt_client:\n    use_external_jwt_api: true\n    external_api: \"@eight_points_guzzle.client.api_jwt\"\n    jwt_token_path: /jwt/token # Endpoint where the token POST request will be done\n```\n\nAnd you must define the api using Guzzle configuration\n\n```yaml\nguzzle:\n    clients:\n        api_jwt:\n            base_url: %api_jwt_base_url%\n```\n\n## Configure security for login form against external JWT server\n\nIn order to make this bundle work you should define your `security.yml` like this\n\n```yaml\n# To get started with security, check out the documentation:\nsecurity:\n    providers:\n        token:\n            id: project.token.user_provider\n\n    firewalls:\n        # disables authentication for assets and the profiler, adapt it according to your needs\n        dev:\n            pattern: ^/(_(profiler|wdt)|css|images|js)/\n            security: false\n\n        main:\n            pattern: ^/\n            provider: token\n            anonymous: true\n            simple_form:\n                authenticator: project.token.external_authenticator\n                check_path: login_check\n                login_path: login\n                # user_referer: true\n                failure_path: login\n            logout:\n                path: /logout\n                target: login\n            remember_me:\n                secret: '%secret%'\n                lifetime: 86400\n                path: /\n\n    access_control:\n        - { path: ^/login, role: IS_AUTHENTICATED_ANONYMOUSLY }\n        - { path: ^/registration, role: IS_AUTHENTICATED_ANONYMOUSLY }\n        - { path: ^/, role: ROLE_ADMIN }\n```\n\nIn `routes.yml` you has to add a login path as those lines for the login fails redirect and add\nthe bundle routes import as well:\n\n```yaml\njwt_client:\n    resource: '@CiriciJWTClientBundle/Resources/config/routing.yml'\n    prefix: /\n\nlogin:\n    path: /login\n```\n\n## Setting up custom User class for incoming requests\n\nIf you want to map the incoming token calls with a custom User class instead of ApiUser you should implement `Cirici\\JWTClientBundle\\Security\\ApiUserInterface` in your custom User class.\nThen configure your custom User class in `config.yml`:\n\n```yaml\ncirici_jwt_client:\n    api_user_class: '\\AppBundle\\Entity\\User'\n```\n\n## Configure to validate incoming Authentication bearer\n\nIn your `security.yml` firewall you has to add the next lines:\n\n```yaml\nsecurity:\n    providers:\n        token:\n            id: project.token.user_provider\n\n    firewalls:\n        api:\n            pattern:   ^/api/user\n            stateless: true\n            guard:\n                provider: token\n                authenticators:\n                    - project.token.authenticator\n```\n\n## Extending login template\n\nIf you want to modify the default login template you should create the next folders\n\n```bash\nmkdir -P app/Resources/CiriciJWTClientBundle/views/Security\n```\n\nAnd then copy the file `login.html.twig` from the bundle to the folder created above.\n\nNow your app will load the login template just copied and you can modify it without altering the bundle one. :)\n\n[build status]: https://travis-ci.org/ciricihq/CiriciJWTClientBundle\n[coverage]: https://codecov.io/gh/ciricihq/CiriciJWTClientBundle\n[license]: https://github.com/ciricihq/CiriciJWTClientBundle/blob/master/LICENSE.md\n[releases]: https://github.com/ciricihq/CiriciJWTClientBundle/releases\n[downloads]: https://packagist.org/packages/ciricihq/CiriciJWTClientBundle\n[climate]: https://codeclimate.com/github/ciricihq/CiriciJWTClientBundle\n\n[build svg]: https://img.shields.io/travis/ciricihq/CiriciJWTClientBundle/master.svg?style=flat-square\n[coverage svg]: https://img.shields.io/codecov/c/github/ciricihq/CiriciJWTClientBundle/master.svg?style=flat-square\n[license svg]: https://img.shields.io/github/license/ciricihq/CiriciJWTClientBundle.svg?style=flat-square\n[releases svg]: https://img.shields.io/github/release/ciricihq/CiriciJWTClientBundle.svg?style=flat-square\n[downloads svg]: https://img.shields.io/packagist/dt/ciricihq/CiriciJWTClientBundle.svg?style=flat-square\n[climate svg]: https://img.shields.io/codeclimate/github/ciricihq/CiriciJWTClientBundle.svg?style=flat-square\n\n[instructions]: http://ypereirareis.github.io/blog/2016/03/16/symfony-lexikjwtauthenticationbundle-client-user-authenticator-provider/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciricihq%2Fciricijwtclientbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fciricihq%2Fciricijwtclientbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciricihq%2Fciricijwtclientbundle/lists"}