{"id":30404679,"url":"https://github.com/dderevjanik/wordpress-jwt-auth","last_synced_at":"2025-08-21T16:27:14.389Z","repository":{"id":47270200,"uuid":"96054023","full_name":"dderevjanik/wordpress-jwt-auth","owner":"dderevjanik","description":"javascript JWT auth for https://github.com/Tmeister/wp-api-jwt-auth","archived":false,"fork":false,"pushed_at":"2025-03-25T09:34:35.000Z","size":55,"stargazers_count":11,"open_issues_count":9,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-09T19:30:15.424Z","etag":null,"topics":["jwt-authentication","typescript","wordpress","wordpress-rest-api"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/dderevjanik.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-07-02T23:19:15.000Z","updated_at":"2024-10-20T12:08:16.000Z","dependencies_parsed_at":"2023-12-27T21:07:32.081Z","dependency_job_id":"682df99c-c22b-4d08-8344-3dccd3fa4891","html_url":"https://github.com/dderevjanik/wordpress-jwt-auth","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"be0048b709305f5e78881e5d3dc3c082338763cf"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dderevjanik/wordpress-jwt-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dderevjanik%2Fwordpress-jwt-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dderevjanik%2Fwordpress-jwt-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dderevjanik%2Fwordpress-jwt-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dderevjanik%2Fwordpress-jwt-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dderevjanik","download_url":"https://codeload.github.com/dderevjanik/wordpress-jwt-auth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dderevjanik%2Fwordpress-jwt-auth/sbom","scorecard":{"id":330185,"data":{"date":"2025-08-11","repo":{"name":"github.com/dderevjanik/wordpress-jwt-auth","commit":"be0048b709305f5e78881e5d3dc3c082338763cf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/9 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"17 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-42xw-2xvc-qx8m","Warn: Project is vulnerable to: GHSA-4w2v-q235-vp99","Warn: Project is vulnerable to: GHSA-cph5-m8f7-6c5x","Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T03:22:51.827Z","repository_id":47270200,"created_at":"2025-08-18T03:22:51.827Z","updated_at":"2025-08-18T03:22:51.827Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271129350,"owners_count":24703881,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-authentication","typescript","wordpress","wordpress-rest-api"],"created_at":"2025-08-21T16:25:04.811Z","updated_at":"2025-08-21T16:27:14.381Z","avatar_url":"https://github.com/dderevjanik.png","language":"TypeScript","readme":"# Wordpress JWT Auth\n\n![travis-badge](https://travis-ci.org/dderevjanik/wordpress-jwt-auth.svg?branch=master)\n\nJS Wrapper for [wp-api-jwt-auth](https://github.com/Tmeister/wp-api-jwt-auth)\n\n## Installation\n\nPlease, make sure that you have:\n\n- installed [wp-api-jwt-auth](https://github.com/Tmeister/wp-api-jwt-auth) and enabled on your wp site\n- enabled [HTTP Authorization Header](https://github.com/Tmeister/wp-api-jwt-auth#eable-php-http-authorization-header)\n- configurated [Secret Key](https://github.com/Tmeister/wp-api-jwt-auth#configurate-the-secret-key) and [CORs Support](https://github.com/Tmeister/wp-api-jwt-auth#configurate-cors-support)\n\ninstall this package:\n\n```bash\nnpm install wordpress-jwt-auth\n```\n\n## Example\n\n### `connectToJwt(host)`\n\nAuthenticate using JWT\n\n```javascript\nimport { connectToJwt } from 'wordpress-jwt-auth';\n\n// Promise\nconnectToJwt('https://www.myhosting.com/wordpress').then((jwtConnection) =\u003e {\n    jwtConnection.generateToken('admin', 'password').then(userConnection) =\u003e {\n        console.log(userConnection.token);\n        // generated token\n\n        jwtConnection.validate().then(validated =\u003e {\n            console.log(validate);\n            // true\n        });\n    });\n});\n\n// Await/Async\nconst jwtConnection = await connectToJwt('https://www.myhosting.com/wordpress');\nconst { token } = await jwtConnection.generateToken('admin', 'password');\nconsole.log(jwtConnection.validate(token));\n// true\n```\n\n### `generateToken(username, password)`\n\nYou can import `generateToken` directly from library\n\n```javascript\nimport { generateToken } from 'wordpress-jwt-auth';\n\nconst { token } = generateToken('admin', 'root');\n```\n\n### Real use\n\nDeleting a post with id `32` from wordpress using [REST API](https://developer.wordpress.org/rest-api/)\n\n```javascript\nimport axios from 'axios';\nimport { connectToJwt } from 'wordpress-jwt-auth';\n\nconst WP_URL = 'https://www.mywordpress.com';\nconst POST_ID_TO_DELETE = 32;\n\nconst { generateToken } = await connectToJwt(WP_URL);\nconst { token } = await generateToken('superadmin', '2489cs12mklz');\nconst authHeader = { headers: { Authorization: `bearer ${token}` } };\n\naxios.delete(`${WP_URL}/wp-json/wp/v2/posts/${POST_ID_TO_DELETE}`, {}, authHeader);\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdderevjanik%2Fwordpress-jwt-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdderevjanik%2Fwordpress-jwt-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdderevjanik%2Fwordpress-jwt-auth/lists"}