{"id":16790912,"url":"https://github.com/rluders/wn-jwtauth-plugin","last_synced_at":"2026-05-24T23:09:51.752Z","repository":{"id":50743663,"uuid":"145203644","full_name":"rluders/wn-jwtauth-plugin","owner":"rluders","description":"JWTAuth Plugin for WinterCMS","archived":false,"fork":false,"pushed_at":"2026-05-16T05:30:28.000Z","size":189,"stargazers_count":30,"open_issues_count":10,"forks_count":29,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-05-16T07:21:29.668Z","etag":null,"topics":["hacktoberfest","jwt","jwt-authentication","jwtauth","token","token-authentication","wintercms","wintercms-plugin"],"latest_commit_sha":null,"homepage":"","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/rluders.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["rluders"],"patreon":"rluders","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-08-18T08:31:33.000Z","updated_at":"2025-07-17T06:11:13.000Z","dependencies_parsed_at":"2024-10-27T11:56:00.912Z","dependency_job_id":"0061961c-dd5c-4572-b16b-415ea49e1322","html_url":"https://github.com/rluders/wn-jwtauth-plugin","commit_stats":{"total_commits":78,"total_committers":16,"mean_commits":4.875,"dds":0.6025641025641026,"last_synced_commit":"a6ca1e2b0268e8e55f816f6373e705c57b3b3695"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/rluders/wn-jwtauth-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rluders%2Fwn-jwtauth-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rluders%2Fwn-jwtauth-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rluders%2Fwn-jwtauth-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rluders%2Fwn-jwtauth-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rluders","download_url":"https://codeload.github.com/rluders/wn-jwtauth-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rluders%2Fwn-jwtauth-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33453615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T19:21:36.376Z","status":"ssl_error","status_checked_at":"2026-05-24T19:21:10.562Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["hacktoberfest","jwt","jwt-authentication","jwtauth","token","token-authentication","wintercms","wintercms-plugin"],"created_at":"2024-10-13T08:32:25.880Z","updated_at":"2026-05-24T23:09:51.747Z","avatar_url":"https://github.com/rluders.png","language":"PHP","funding_links":["https://github.com/sponsors/rluders","https://patreon.com/rluders","https://www.patreon.com/rluders"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"jwt.png\" style=\"border:1px solid #ddd;width:auto;\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://wintercms.com/plugin/rluders-jwtauth\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Winter%20CMS-Plugin-%23EE7203.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/rluders/wn-jwtauth-plugin/actions/workflows/test.yml\"\u003e\n    \u003cimg src=\"https://github.com/rluders/wn-jwtauth-plugin/actions/workflows/test.yml/badge.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.patreon.com/rluders\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Support_on-Patreon-green.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.gnu.org/licenses/gpl-3.0.en.html\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/rluders/oc-jwtauth-plugin.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# Introduction\n\nThis plugin provides a JSON Web Tokens authentication mechanism for [Winter CMS](http://www.wintercms.com) integrated with `Winter.User`. It's essential for your web application built with Angular, Vue.js, React or other modern Javascript frameworks.\n\n## Requirements\n\n- PHP 8.1+\n- WinterCMS 1.2+ (Laravel 9) or 1.3+ (Laravel 10)\n- [Winter.User](https://github.com/wintercms/wn-user-plugin) plugin `^2.0`\n- [RLuders.CORS](https://wintercms.com/plugin/rluders-cors) plugin (optional, but recommended)\n\n## Theme\n\n- [Angular Skeleton](https://wintercms.com/theme/rluders-angular2)\n\n## Tutorials\n\n- [Creating Vue, Vuex and Winter CMS APP - Login and Register](https://www.youtube.com/watch?v=8S3DySmMOuk) by [Watch and Learn](https://www.youtube.com/channel/UCXQC_GB5hG6PkzIhSMZ-hWA)\n\n# Installation\n\n```sh\n$ composer require rluders/jwtauth\n```\n\n# Configuration\n\nYou must set a secret token for your application. Do do it, on Winter's Backend access: _Settings \u003e Users \u003e JWTAuth_\n\n# Usage\n\nHere's the list of available endpoints for this plugin.\n\n\u003e If you are using [**Postman**](https://www.getpostman.com/), you can [click here to import the collection](https://www.getpostman.com/collections/5667c055f6f81ff3f821) with all the calls that you need to test it.\n\n## Login\n\n`POST /api/auth/login`\n\n**Route name**\n\n`api.auth.login`\n\n### Parameters\n\n| Name     | Type   | Required | Description             |\n| -------- | ------ | -------- | ----------------------- |\n| login    | string | Yes      | Account login attribute |\n| password | string | Yes      | Account password        |\n\n\u003e The field `login` value can be the account `email` or `username`. You can select it on `Winter.User` configuration what field should be used for login.\n\n### Responses\n\n**SUCCESS**\n\n\u003e Code: 200\n\n```json\n{\n  \"token\": string,\n  \"user\": object\n}\n```\n\n**ERROR**\n\n\u003e Code: 401\n\n```json\n{\n  \"error\":\n    invalid_credentials |\n    could_not_create_token |\n    user_inactive |\n    user_is_banned\n}\n```\n\n## Register\n\n`POST /api/auth/register`\n\n**Route name**\n\n`api.auth.register`\n\n### Parameters\n\n| Name                  | Type   | Required | Description              |\n| --------------------- | ------ | -------- | ------------------------ |\n| username              | string | No       | Account username         |\n| email                 | string | Yes      | Account email            |\n| password              | string | Yes      | Account password         |\n| password_confirmation | string | No       | Confirm the new password |\n\n\u003e The field `username` can be **required**. It depends of your `Winter.User` configuration.\n\n### Responses\n\n**SUCCESS**\n\n\u003e Code: 201\n\n```json\n[]\n```\n\n**ERROR**\n\n\u003e Code: 401\n\n```json\n{\n  \"error\": object | registration_disabled\n}\n```\n\n### Supported events\n\n- `Winter.User.beforeRegister`\n- `Winter.User.register`\n\n## Account Activation\n\n`POST /api/auth/account-activation`\n\n**Route name**\n\n`api.auth.account-activation`\n\n### Parameters\n\n| Name            | Type   | Required | Description             |\n| --------------- | ------ | -------- | ----------------------- |\n| activation_code | string | Yes      | Account activation code |\n\n### Responses\n\n**SUCCESS**\n\n\u003e Code: 200\n\n```json\n[]\n```\n\n**ERROR**\n\n\u003e Code: 422\n\n```json\n{\n  \"error\": invalid_activation_code | invalid_user | user_not_found\n}\n```\n\n## Forgot Password\n\n`POST /api/auth/forgot-password`\n\n**Route name**\n\n`api.auth.forgot-password`\n\n### Parameters\n\n| Name  | Type   | Required | Description   |\n| ----- | ------ | -------- | ------------- |\n| email | string | Yes      | Account email |\n\n### Responses\n\n**SUCCESS**\n\n\u003e Code: 200\n\n```json\n[]\n```\n\n**ERROR**\n\n\u003e Code: 404\n\n```json\n{\n  \"error\": user_not_found\n}\n```\n\n## Reset Password\n\n`POST /api/auth/reset-password`\n\n**Route name**\n\n`api.auth.reset-password`\n\n### Parameters\n\n| Name                  | Type   | Required | Description              |\n| --------------------- | ------ | -------- | ------------------------ |\n| reset_password_code   | string | Yes      | Reset password code      |\n| password              | string | Yes      | Account new password     |\n| password_confirmation | string | No       | Confirm the new password |\n\n### Responses\n\n**SUCCESS**\n\n\u003e Code: 200\n\n```json\n[]\n```\n\n**ERROR**\n\n\u003e Code: 422\n\n```json\n{\n  \"error\":\n    invalid_reset_password_code | invalid_user | invalid_reset_password_code\n}\n```\n\n## Refresh Token\n\n`POST /api/auth/refresh-token`\n\n**Route name**\n\n`auth.api.refresh-token`\n\n### Parameters\n\n| Name  | Type   | Required | Description        |\n| ----- | ------ | -------- | ------------------ |\n| token | string | Yes      | Valid user JWToken |\n\n### Responses\n\n**SUCCESS**\n\n\u003e Code: 200\n\n```json\n{\n  \"token\": string\n}\n```\n\n**ERROR**\n\n\u003e Code: 403\n\n```json\n{\n  \"error\": could_not_refresh_token | given_token_was_blacklisted\n}\n```\n\n## Get User\n\n`GET /api/auth/me`\n\n**Middleware**\n\n`jwt.auth`\n\n**Route name**\n\n`api.auth.me`\n\n### Parameters\n\n| Name  | Type   | Required | Description |\n| ----- | ------ | -------- | ----------- |\n| token | string | Yes      | Valid token |\n\n### Responses\n\n**SUCCESS**\n\n\u003e Code: 200\n\n```json\n{\n  \"user\": object\n}\n```\n\n**ERROR**\n\n\u003e Code: 404\n\n```json\n{\n  \"error\": user_not_found\n}\n```\n\n## Logout\n\n`POST /api/auth/logout`\n\n**Middleware**\n\n`jwt.auth`\n\n**Route name**\n\n`api.auth.logout`\n\nInvalidates (blacklists) the current JWT. The token cannot be used again.\n\n### Responses\n\n**SUCCESS**\n\n\u003e Code: 204 No Content\n\n**ERROR**\n\n\u003e Code: 401 — Missing or invalid token\n\n---\n\n# Advanced\n\n## Custom JWT Claims\n\nOther plugins can add custom claims to the JWT by listening to the `rluders.jwtauth.customClaims` event.\nThe listener receives `(\u0026$claims, $user)` — modify the `$claims` array by reference.\n\n```php\n// In another plugin's boot() method\nEvent::listen('rluders.jwtauth.customClaims', function (\u0026$claims, $user) {\n    $claims['role'] = $user-\u003erole;\n    $claims['org']  = $user-\u003eorganisation_id;\n});\n```\n\n## OpenAPI / Swagger Spec\n\nA machine-readable API spec is available at [openapi.yaml](openapi.yaml).\nImport it into Postman, Insomnia, Swagger UI, or any OpenAPI-compatible tooling.\n\n## Testing\n\nRequires [Podman](https://podman.io/) or Docker.\n\n```bash\n# Build test image and run the full test suite\nmake test\n\n# Unit tests only\nmake test-unit\n\n# Feature tests only\nmake test-feature\n\n# Drop into the container shell for debugging\nmake shell\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for the commit convention and PR workflow.\n\n---\n\n# Known issues\n\nBeside the fact that I'm always trying to solve the possible issues, bad things could happen. Here, an list of possible issues and how to fix it.\n\n## Note to Apache users\n\nIn order to use the authorization Bearer Token you must add the following code to your `.httaccess`\n\n```\nRewriteEngine On\nRewriteCond %{HTTP:Authorization} ^(.*)\nRewriteRule .* - [e=HTTP_AUTHORIZATION:%1]\n```\n\n# License\n\nGPLv3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frluders%2Fwn-jwtauth-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frluders%2Fwn-jwtauth-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frluders%2Fwn-jwtauth-plugin/lists"}