{"id":47111089,"url":"https://github.com/systelab/cpp-jwt-utils","last_synced_at":"2026-03-12T17:45:57.087Z","repository":{"id":90260471,"uuid":"170819253","full_name":"systelab/cpp-jwt-utils","owner":"systelab","description":"C++ JSON Web Token Utilities","archived":false,"fork":false,"pushed_at":"2025-09-17T10:28:38.000Z","size":156,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-09-17T12:33:18.109Z","etag":null,"topics":["cpp-library"],"latest_commit_sha":null,"homepage":"","language":"C++","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/systelab.png","metadata":{"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-02-15T07:18:42.000Z","updated_at":"2025-09-17T10:27:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"e9bb1040-f351-45fe-9ce0-13e14cb4687c","html_url":"https://github.com/systelab/cpp-jwt-utils","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/systelab/cpp-jwt-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systelab%2Fcpp-jwt-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systelab%2Fcpp-jwt-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systelab%2Fcpp-jwt-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systelab%2Fcpp-jwt-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/systelab","download_url":"https://codeload.github.com/systelab/cpp-jwt-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systelab%2Fcpp-jwt-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30436009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: 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":["cpp-library"],"created_at":"2026-03-12T17:45:56.414Z","updated_at":"2026-03-12T17:45:57.066Z","avatar_url":"https://github.com/systelab.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/systelab/cpp-jwt-utils.svg?branch=master)](https://travis-ci.org/systelab/cpp-jwt-utils)\n[![Build status](https://ci.appveyor.com/api/projects/status/jtbc93k8i6vtnx56?svg=true)](https://ci.appveyor.com/project/systelab/cpp-jwt-utils)\n[![codecov](https://codecov.io/gh/systelab/cpp-jwt-utils/branch/master/graph/badge.svg)](https://codecov.io/gh/systelab/cpp-jwt-utils)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ac813b263f804fcc843ded14e011a5d1)](https://www.codacy.com/gh/systelab/cpp-jwt-utils/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=systelab/cpp-jwt-utils\u0026amp;utm_campaign=Badge_Grade)\n\n\n# C++ JSON Web Token Utilities\n\nThis library provides utilities to generate, parse and validate JWTs (JSON Web Tokens) used to implement an authentication mechanism over a REST API. \n\n\n## Setup\n\n### Download using Conan\n\nThis library is designed to be installed by making use of [Conan](https://conan.io/) package manager. So, you just need to add the following requirement into your Conan recipe:\n\n```python\ndef requirements(self):\n   self.requires(\"JWTUtils/1.0.0@systelab/stable\")\n```\n\n\u003e Version number of this code snipped is set just as an example. Replace it for the desired package to retrieve.\n\nAs this package is not available on the conan-center, you will also need to configure a remote repository before installing dependencies:\n\n```bash\nconan remote add systelab-public https://csw.jfrog.io/artifactory/api/conan/cpp-conan-production-local\n```\n\nSee Conan [documentation](https://docs.conan.io/en/latest/) for further details on how to integrate this package with your build system.\n\n### Build from sources\n\nSee [BUILD.md](BUILD.md) document for details.\n\n\n## Usage\n\n### Build a token\n\nUse the `systelab::jwt::TokenBuilderService` class to generate a valid token containing a vector of claims:\n\n```cpp\n#include \"RapidJSONAdapter/JSONAdapter.h\"\n#include \"JWTUtils/Services/TokenBuilderService.h\"\n\nsystelab::json::rapidjson::JSONAdapter jsonAdapter;\nsystelab::jwt::TokenBuilderService tokenBuilderService(jsonAdapter);\n\nstd::string secretKey = \"Here goes your secret key\";\nstd::vector\u003c std::pair\u003cstd::string, std::string\u003e \u003e claims =\n    { {\"sub\", \"1234567890\"}, {\"name\", \"John Doe\"}, {\"iat\", \"1516239022\"} };\n\nstd::string token = tokenBuilderService.buildJWT(secretKey, claims);\n```\n\n### Parse a token\n\nUse the `systelab::jwt::TokenParserService` class to parse a JWT token and retrieve the claims contained on it. It will return false when the provided JWT is not valid.\n\n```cpp\n#include \"RapidJSONAdapter/JSONAdapter.h\"\n#include \"JWTUtils/Services/TokenParserService.h\"\n\nsystelab::json::rapidjson::JSONAdapter jsonAdapter;\nsystelab::jwt::TokenParserService tokenParserService(jsonAdapter);\n\nstd::string token = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.\"\n                    \"eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoiMTUxNjIzOTAyMiJ9.\"\n                    \"5ODOvx-citIP2b7EbnG1TlSUcoAKmCeOyE-_Kw3-dLo\";\nstd::string secretKey = \"Here goes your secret key\";\n\nstd::vector\u003c std::pair\u003cstd::string, std::string\u003e \u003e claims;\nbool valid = tokenParserService.validateJWT(token, secretKey, claims);\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystelab%2Fcpp-jwt-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystelab%2Fcpp-jwt-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystelab%2Fcpp-jwt-utils/lists"}