{"id":20163430,"url":"https://github.com/sjinks/wp-jwt-auth","last_synced_at":"2025-10-24T01:40:09.779Z","repository":{"id":44731860,"uuid":"288757230","full_name":"sjinks/wp-jwt-auth","owner":"sjinks","description":"WordPress plugin for JWT authentication for the REST / XML-RPC API","archived":false,"fork":false,"pushed_at":"2023-03-29T00:44:33.000Z","size":179,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T14:22:02.409Z","etag":null,"topics":["authentication","jwt","jwt-authentication","rest-api","wordpress-plugin"],"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/sjinks.png","metadata":{"funding":{"custom":["https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU","https://send.monobank.ua/jar/7rosVfiwKM"]},"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}},"created_at":"2020-08-19T14:40:48.000Z","updated_at":"2021-12-22T02:49:11.000Z","dependencies_parsed_at":"2024-11-14T00:39:44.232Z","dependency_job_id":null,"html_url":"https://github.com/sjinks/wp-jwt-auth","commit_stats":{"total_commits":45,"total_committers":3,"mean_commits":15.0,"dds":0.5333333333333333,"last_synced_commit":"fe7ccca8401e52d0565675fd2e03b06085583b4b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fwp-jwt-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fwp-jwt-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fwp-jwt-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fwp-jwt-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjinks","download_url":"https://codeload.github.com/sjinks/wp-jwt-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241600493,"owners_count":19988715,"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":["authentication","jwt","jwt-authentication","rest-api","wordpress-plugin"],"created_at":"2024-11-14T00:29:33.911Z","updated_at":"2025-10-24T01:40:09.701Z","avatar_url":"https://github.com/sjinks.png","language":"PHP","funding_links":["https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU","https://send.monobank.ua/jar/7rosVfiwKM"],"categories":[],"sub_categories":[],"readme":"# wp-jwt-auth\n\nWordPress plugin for JWT authentication for the REST / XML-RPC API\n\n## Installation\n\n### Composer Way\n\n```bash\ncomposer require wildwolf/wp-jwt-auth\n```\n\nThen go to Admin Dashboard, Plugins, find and activate the \"WW JWT Auth\" plugin\n\n### Manual Way\n\nGrab the plugin zip file from Releases, then go to Admin Dashboard, Plugins, Add New, Upload Plugin. Select the zip file, the click Install Now. Finally, activate the plugin.\n\n## REST API Authentication\n\nThe plugin uses *bearer authentication* (also known as *token authentication*) to authenticate the user.\n\nTo authenticate the request, you need to have a JWT. Then you need to set the `Authorization` header:\n\n```\nAuthorization: Bearer jwt-goes-here\n```\n\n## API\n\n### REST API\n\n#### Generate Token\n\n`POST /wp-json/wildwolf/jwtauth/v1/generate`\n\nor\n\n`POST /wp-json/jwt-auth/v1/token`\n\nRequest body:\n* `username`: login;\n* `password`: password.\n\nSuccessful Response:\nStatus code: 200\nJSON Object:\n* `token`: JWT token;\n* `user_email`: email address of the user;\n* `display_name`: display name of the user.\n\nFailure:\nStatus code: 403 for authentication failures, 500 for misconfiguration (JWT secret is not set)\n\n#### Validate Token\n\n`GET /wp-json/wildwolf/jwtauth/v1/verify`\n\nor\n\n`GET /wp-json/jwt-auth/v1/token/validate`\n\nRequired headers:\n* `Authorization: Bearer JWT-goes-here`\n\nSuccessfule response:\nStatus code: 200\n\nFailure:\nStatus code: 403\n\n### WordPress Filters\n\n#### jwt_auth_not_before\n\nUsed to filter the `nbf` (not before) claim for the token.\nParameters:\n* `int $value`: filtered value; set to the value of the `iat` (issued at) claim;\n* `int $iat`: the original unfiltered `iat` value.\nExpects: integer, the new value for the `nbf` claim.\n\n### jwt_auth_not_after\n\nUsed to filter the `exp` (expiration) claim for the token.\nParameters:\n* `int $value`: filtered value; set to the value of the `iat` (issued at) claim plus the value of the JWT TTL setting;\n* `int $iat`: the `iat` value;\n* `int $ttl`: the JWT time to live value.\nExpects: integer, the new value for the `exp` claim.\n\n### jwt_auth_token_before_sign\n\nUsed to filter the JWT payload before signing.\nParameters:\n* `array $token`: JWT payload. By default, it contains the following fields:\n  * `iss`: token issuer; equal to the URL of the site (`get_bloginfo( 'url' )`);\n  * `iat`: time the token was issued at;\n  * `nbf`: time before which the JWT must not be accepted for processing;\n  * `exp`: expiration time on or after which the JWT must not be accepted for processing;\n  * `sub`: the ID of the user\n* `WP_User $user`: the authenticated user.\nExpects: array, the new payload to sign.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fwp-jwt-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjinks%2Fwp-jwt-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fwp-jwt-auth/lists"}