{"id":19894710,"url":"https://github.com/matteobaccan/harbourjwt","last_synced_at":"2026-03-02T23:40:20.449Z","repository":{"id":37860594,"uuid":"467505898","full_name":"matteobaccan/HarbourJwt","owner":"matteobaccan","description":"JWT Implementation for Harbour","archived":false,"fork":false,"pushed_at":"2026-01-20T15:11:04.000Z","size":118,"stargazers_count":8,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-20T22:50:43.087Z","etag":null,"topics":["hacktoberfest","harbour","harbour-language","jwt"],"latest_commit_sha":null,"homepage":"","language":"xBase","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/matteobaccan.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["matteobaccan"]}},"created_at":"2022-03-08T12:38:15.000Z","updated_at":"2026-01-20T15:02:14.000Z","dependencies_parsed_at":"2023-09-23T13:55:01.584Z","dependency_job_id":"6b50384d-8ae5-4d71-9502-7bf845351ca3","html_url":"https://github.com/matteobaccan/HarbourJwt","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/matteobaccan/HarbourJwt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteobaccan%2FHarbourJwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteobaccan%2FHarbourJwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteobaccan%2FHarbourJwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteobaccan%2FHarbourJwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matteobaccan","download_url":"https://codeload.github.com/matteobaccan/HarbourJwt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteobaccan%2FHarbourJwt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30025477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T23:36:48.274Z","status":"ssl_error","status_checked_at":"2026-03-02T23:33:36.569Z","response_time":60,"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","harbour","harbour-language","jwt"],"created_at":"2024-11-12T18:34:23.604Z","updated_at":"2026-03-02T23:40:20.442Z","avatar_url":"https://github.com/matteobaccan.png","language":"xBase","funding_links":["https://github.com/sponsors/matteobaccan"],"categories":[],"sub_categories":[],"readme":"# HarbourJwt\n\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/297af1f39d004d7992599ce45fcd3b6a)](https://www.codacy.com/gh/matteobaccan/HarbourJwt/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=matteobaccan/HarbourJwt\u0026amp;utm_campaign=Badge_Grade)\n\nJWT Implementation for Harbour\n\nA simple library to work with JSON Web Token and JSON Web Signature for Harbour language.\nYou can find more information about JWT on the [official website](https://jwt.io).\n\nHarbour JWT supports the following algorithms:\n\n- HS256\n- HS384\n- HS512\n\n\u003c!--\n    (CVE-2015-2951) The alg=none signature-bypass vulnerability\n    (CVE-2016-10555) The RS/HS256 public key mismatch vulnerability\n    (CVE-2018-0114) Key injection vulnerability\n    (CVE-2019-20933/CVE-2020-28637) Blank password vulnerability\n    (CVE-2020-28042) Null signature vulnerability\n--\u003e\n\n## Installation\n\nPackage is available on [GitHub](https://github.com/matteobaccan/HarbourJwt/blob/main/lib/jwt.hrb),\n\n```shell\nwget https://raw.githubusercontent.com/matteobaccan/HarbourJwt/main/lib/jwt.hrb\n```\n\n## Documentation\n\nJWT is a class library that can allow you to generate and validate JWT tokens\n\n### Token generation\n\nTo create a token you must\n\n1 Load jwt.hrb library\n\n```xBase\nLOCAL handle := hb_hrbLoad( \"jwt.hrb\" )\n```\n\n2 Create an empty JWT object\n\n```xBase\nLOCAL oJWT\nLOCAL cToken\n\n// Object\noJWT := \u0026(\"JWT():new()\")\n```\n\n3 Configure a valid header, setting Type = JWT and an available Algorithm.\n   At the moment the Algorithms available are: HS256, HS384, and HS512\n\n```xBase\n// Header\noJWT:setAlgorithm(\"HS256\")\noJWT:setType(\"JWT\")\n```\n\n4 Load a payload. The properties permitted in a payload are:\n\n```xBase\nMETHOD SetIssuer( cIssuer )\nMETHOD SetSubject( cSubject )\nMETHOD SetAudience( cAudience )\nMETHOD SetExpration( nExpiration )\nMETHOD SetNotBefore( nNotBefore )\nMETHOD SetIssuedAt( nIssuedAt )\nMETHOD SetJWTId( cJWTId )\n```\n\nA simple payload can be formed by: Subject, Name, and IssueAt\n\n```xBase\n// Payload\noJWT:setSubject(\"1234567890\")\noJWT:setPayloadData(\"name\", \"John Doe\")\noJWT:setIssuedAt(1516239022)\n```\n\n5 Finally you must indicate a secret\n\n```xBase\n// Secret\noJWT:setSecret(\"your-256-bit-secret\")\n```\n\n6 Now you can get a token\n\n```xBase\n// Get Token\ncToken = oJWT:Encode()\n```\n\n```Text\neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\n```\n\n### Token verification\n\nToken verifications are also simple\n\n1 Load jwt.hrb library\n\n```xBase\nLOCAL handle := hb_hrbLoad( \"jwt.hrb\" )\n```\n\n2 Create an empty JWT object\n\n```xBase\nLOCAL oJWT\n\n// Object\noJWT := \u0026(\"JWT():new()\")\n```\n\n3 Verify the token\n\n```xBase\noJWT:SetSecret(\"MySecret\")\noJWT:Verify(\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ik1hdHRlbyBCYWNjYW4iLCJpYXQiOjE1MTYyMzkwMjJ9.YR8QF52kgj0owYlP9TkEy_lNhC-Qdq38tqNNNqpvpK0\")\n```\n\nVerify return a .T. if the token is valid. Otherwise with\n\n```xBase\noJWT:GetError()\n```\n\nyou can get the decode error\n\n## Contribution\n\nFeel free to update this code with a new PR\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatteobaccan%2Fharbourjwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatteobaccan%2Fharbourjwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatteobaccan%2Fharbourjwt/lists"}