{"id":24257667,"url":"https://github.com/ballerina-platform/module-ballerina-jwt","last_synced_at":"2026-01-31T21:15:05.698Z","repository":{"id":36961938,"uuid":"265136450","full_name":"ballerina-platform/module-ballerina-jwt","owner":"ballerina-platform","description":"Ballerina JWT module.","archived":false,"fork":false,"pushed_at":"2025-11-03T03:48:28.000Z","size":2926,"stargazers_count":124,"open_issues_count":2,"forks_count":32,"subscribers_count":66,"default_branch":"master","last_synced_at":"2025-11-03T05:27:27.689Z","etag":null,"topics":["ballerina","ballerina-lang","hacktoberfest","integration","jwt","wso2"],"latest_commit_sha":null,"homepage":"","language":"Ballerina","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ballerina-platform.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":".github/CODEOWNERS","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":"2020-05-19T03:45:40.000Z","updated_at":"2025-11-03T03:48:32.000Z","dependencies_parsed_at":"2023-10-03T11:36:59.802Z","dependency_job_id":"bfe189ca-223f-48d5-a775-963bb3159a7c","html_url":"https://github.com/ballerina-platform/module-ballerina-jwt","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/ballerina-platform/module-ballerina-jwt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballerina-platform%2Fmodule-ballerina-jwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballerina-platform%2Fmodule-ballerina-jwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballerina-platform%2Fmodule-ballerina-jwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballerina-platform%2Fmodule-ballerina-jwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ballerina-platform","download_url":"https://codeload.github.com/ballerina-platform/module-ballerina-jwt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballerina-platform%2Fmodule-ballerina-jwt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28955278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T18:30:42.805Z","status":"ssl_error","status_checked_at":"2026-01-31T18:30:19.593Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["ballerina","ballerina-lang","hacktoberfest","integration","jwt","wso2"],"created_at":"2025-01-15T05:01:42.590Z","updated_at":"2026-01-31T21:15:05.692Z","avatar_url":"https://github.com/ballerina-platform.png","language":"Ballerina","funding_links":[],"categories":["Libraries"],"sub_categories":["Ballerina"],"readme":"Ballerina JWT Library\n===================\n\n  [![Build](https://github.com/ballerina-platform/module-ballerina-jwt/actions/workflows/build-timestamped-master.yml/badge.svg)](https://github.com/ballerina-platform/module-ballerina-jwt/actions/workflows/build-timestamped-master.yml)\n  [![codecov](https://codecov.io/gh/ballerina-platform/module-ballerina-jwt/branch/master/graph/badge.svg)](https://codecov.io/gh/ballerina-platform/module-ballerina-jwt)\n  [![Trivy](https://github.com/ballerina-platform/module-ballerina-jwt/actions/workflows/trivy-scan.yml/badge.svg)](https://github.com/ballerina-platform/module-ballerina-jwt/actions/workflows/trivy-scan.yml)\n  [![GraalVM Check](https://github.com/ballerina-platform/module-ballerina-jwt/actions/workflows/build-with-bal-test-graalvm.yml/badge.svg)](https://github.com/ballerina-platform/module-ballerina-jwt/actions/workflows/build-with-bal-test-graalvm.yml)\n  [![GitHub Last Commit](https://img.shields.io/github/last-commit/ballerina-platform/module-ballerina-jwt.svg?label=Last%20Commit)](https://github.com/ballerina-platform/module-ballerina-jwt/commits/master)\n  [![GitHub issues](https://img.shields.io/github/issues/ballerina-platform/ballerina-standard-library/module/jwt.svg?label=Open%20Issues)](https://github.com/ballerina-platform/ballerina-standard-library/labels/module%2Fjwt)\n\nThis library provides a framework for authentication/authorization with JWTs and generation/validation of JWTs as specified in the [RFC 7519](https://datatracker.ietf.org/doc/html/rfc7519), [RFC 7515](https://datatracker.ietf.org/doc/html/rfc7515), and [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517).\n\nJSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties. The claims in a JWT are encoded as a JSON object that is used as the payload of a JSON Web Signature (JWS) structure or as the plaintext of a JSON Web Encryption (JWE) structure enabling the claims to be signed digitally or protecting the integrity with a Message Authentication Code(MAC) and/or encrypted.\n\nThe Ballerina `jwt` library facilitates auth providers that are to be used by the clients and listeners of different protocol connectors. Also, it provides the APIs for issuing a self-signed JWT and validating a JWT.\n\n### Listener JWT Auth provider\n\nRepresents the listener JWT Auth provider, which is used to authenticate the provided credentials (JWT) against the provided JWT validator configurations.\n\n### Client JWT Auth provider\n\nRepresents the client JWT Auth provider, which is used to authenticate with an external endpoint by issuing a self-signed JWT against the provided JWT issuer configurations.\n\n### JWT issuer\n\nA self-signed JWT can be issued with the provided configurations using this API as follows:\n\n```ballerina\njwt:IssuerConfig issuerConfig = {\n    username: \"ballerina\",\n    issuer: \"wso2\",\n    audience: \"vEwzbcasJVQm1jVYHUHCjhxZ4tYa\",\n    expTime: 3600,\n    signatureConfig: {\n        config: {\n            keyFile: \"/path/to/private.key\"\n        }\n    }\n};\n\nstring jwt = check jwt:issue(issuerConfig);\n```\n\n### JWT validator\n\nA JWT can be validated with the provided configurations using the API as follows:\n\n```ballerina\nstring jwt = \"eyJ0eXAiOiJKV1QiLA0KI[...omitted for brevity...]mB92K27uhbwW1gFWFOEjXk\";\n\njwt:ValidatorConfig validatorConfig = {\n    issuer: \"wso2\",\n    audience: \"vEwzbcasJVQm1jVYHUHCjhxZ4tYa\",\n    clockSkew: 60,\n    signatureConfig: {\n        certFile: \"/path/to/public.crt\"\n    }\n};\n\njwt:Payload result = check jwt:validate(jwt, validatorConfig);\n```\n\n## Issues and projects\n\nIssues and Projects tabs are disabled for this repository as this is part of the Ballerina Standard Library. To report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina Standard Library parent repository](https://github.com/ballerina-platform/ballerina-standard-library).\n\nThis repository only contains the source code for the module.\n\n## Build from the source\n\n### Set up the prerequisites\n\n1. Download and install Java SE Development Kit (JDK) version 21 (from one of the following locations).\n\n   * [Oracle](https://www.oracle.com/java/technologies/downloads/)\n   \n   * [OpenJDK](https://adoptium.net)\n   \n        \u003e **Note:** Set the `JAVA_HOME` environment variable to the path name of the directory into which you installed JDK.\n\n2. Export your GitHub Personal Access Token (PAT) with the `read package` permission as follows:\n\n    ```\n    export packageUser=\u003cUsername\u003e\n    export packagePAT=\u003cPersonal Access Token\u003e\n    ```\n\n3. Download and install [Docker](https://www.docker.com/).\n\n### Build the source\n\nExecute the commands below to build from the source.\n\n1. To build the package:\n    ```    \n    ./gradlew clean build\n    ```\n2. To run the tests:\n    ```\n    ./gradlew clean test\n    ```\n\n3. To run a group of tests\n    ```\n    ./gradlew clean test -Pgroups=\u003ctest_group_names\u003e\n    ```\n\n4. To build the without the tests:\n    ```\n    ./gradlew clean build -x test\n    ```\n\n5. To debug package implementation:\n    ```\n    ./gradlew clean build -Pdebug=\u003cport\u003e\n    ```\n\n6. To debug with Ballerina language:\n    ```\n    ./gradlew clean build -PbalJavaDebug=\u003cport\u003e\n    ```\n\n7. Publish the generated artifacts to the local Ballerina central repository:\n    ```\n    ./gradlew clean build -PpublishToLocalCentral=true\n    ```\n\n8. Publish the generated artifacts to the Ballerina central repository:\n    ```\n    ./gradlew clean build -PpublishToCentral=true\n    ```\n\n## Contribute to Ballerina\n\nAs an open source project, Ballerina welcomes contributions from the community.\n\nFor more information, go to the [contribution guidelines](https://github.com/ballerina-platform/ballerina-lang/blob/master/CONTRIBUTING.md).\n\n## Code of conduct\n\nAll contributors are encouraged to read the [Ballerina Code of Conduct](https://ballerina.io/code-of-conduct).\n\n## Useful links\n\n* For more information go to the [`jwt` library](https://lib.ballerina.io/ballerina/jwt/latest).\n* For example demonstrations of the usage, go to [Ballerina By Examples](https://ballerina.io/learn/by-example/).\n* Chat live with us via our [Discord server](https://discord.gg/ballerinalang).\n* Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fballerina-platform%2Fmodule-ballerina-jwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fballerina-platform%2Fmodule-ballerina-jwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fballerina-platform%2Fmodule-ballerina-jwt/lists"}