{"id":19691483,"url":"https://github.com/99x/azure-jwt-verify","last_synced_at":"2025-04-29T09:31:05.505Z","repository":{"id":99586203,"uuid":"80691844","full_name":"99x/azure-jwt-verify","owner":"99x","description":"Verify jwt token issued from azure active directory b2c service","archived":false,"fork":false,"pushed_at":"2024-02-15T20:16:25.000Z","size":15,"stargazers_count":18,"open_issues_count":12,"forks_count":17,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-04T13:41:21.620Z","etag":null,"topics":["azure","jwt","npm-package","verify"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/99x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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-02-02T04:03:08.000Z","updated_at":"2023-04-20T22:58:29.000Z","dependencies_parsed_at":"2024-06-18T22:43:35.864Z","dependency_job_id":"82f85213-0ed2-42b1-a74a-260cbc94db93","html_url":"https://github.com/99x/azure-jwt-verify","commit_stats":null,"previous_names":["99xt/azure-jwt-verify"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/99x%2Fazure-jwt-verify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/99x%2Fazure-jwt-verify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/99x%2Fazure-jwt-verify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/99x%2Fazure-jwt-verify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/99x","download_url":"https://codeload.github.com/99x/azure-jwt-verify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251473193,"owners_count":21595021,"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":["azure","jwt","npm-package","verify"],"created_at":"2024-11-11T19:09:21.887Z","updated_at":"2025-04-29T09:31:03.429Z","avatar_url":"https://github.com/99x.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"azure-jwt-verify\n=================================\n\n[![npm version](https://badge.fury.io/js/azure-jwt-verify.svg)](https://www.npmjs.com/package/azure-jwt-verify)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## This Plugin Requires\n* NodeJS Runtime\n\n## Features\n* Verify JWT Token issued by Azure Active Directory B2C\n* Automatically use the rotated public key from Azure Public Keys URL\n\n## Install Plugin\n`npm install --save azure-jwt-verify`\n \n## Using Azure JWT Verify in your code\nYou need to define the following constants based on your Azure Active Directory B2C application configurations\n\n### Initialize module\n```javascript\nvar azureJWT = require('azure-jwt-verify');\n\n```\n\n### Configuration and the JWT to verify\n```javascript\nvar jwtToken = \"YOUR_JWT_TOKEN_TO_VERIFY\"; // You can find this url in Azure Active Directory B2C Section\nconst config = {\n    JWK_URI: \"\",\n    ISS: \"\",\n    AUD: \"\"\n};\n```\n* JWK_URI and the ISS(Issuer) can be obtained from the metadata endpoint of the policies created in the B2C tenant.\n* AUD(Audience) is the Client ID of the application accessing the tenant.\n\n### Verify Function\n```javascript\nazureJWT.verify(jwtToken, config).then(function(decoded){\n// success callback\n\n}, function(error){\n// error callback\n\n})\n```\n\n## Response Examples\n\n#### For valid and authorize JWT token.\n\nResponse body:\n```JSON\n{\n   \"status\": \"success\",\n   \"message\": {\n      \"exp\": 1486111778,\n      \"nbf\": 1486108178,\n      \"ver\": \"1.0\",\n      \"iss\": \"https://login.microsoftonline.com/9434db1e-33cd-4607-b350-9d947127a5de/v2.0/\",\n      \"sub\": \"ff8490cb-2bda-4cc8-b801-4a22a8620c59\",\n      \"aud\": \"dfc54797-efe3-4db3-a1e1-422b4ecf27d7\",\n      \"nonce\": \"defaultNonce\",\n      \"iat\": 1486108178,\n      \"auth_time\": 1486108178,\n      \"oid\": \"ff8490cb-2bda-4cc8-b801-4a22a8620c59\",\n      \"name\": \"jon snow\",\n      \"extension_NIC\": \"933132325V\",\n      \"emails\": [\n         \"hellodishan@gmail.com\"\n      ],\n      \"tfp\": \"B2C_1_b2c_1_sign_in\"\n   }\n}\n```\n\n#### For valid but expired JWT token.\n\nResponse body:\n```JSON\n{\n   \"status\": \"error\",\n   \"message\": {\n      \"name\": \"TokenExpiredError\",\n      \"message\": \"jwt expired\",\n      \"expiredAt\": \"2017-02-02T12:30:11.000Z\"\n   }\n}\n```\n\n#### For invalid JWT token.\n\nResponse body:\n```JSON\n{\n   \"status\": \"error\",\n   \"message\": \"Error Decoding JWT Token\"\n}\n```\n\n\n\n\n## Links\n* [Azure Active Directory B2C](https://azure.microsoft.com/en-us/services/active-directory-b2c/)\n* [Contact Us](mailto:ashanf@99x.lk)\n* [NPM Registry](https://www.npmjs.com/package/azure-jwt-verify)\n\n## License\n  [MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F99x%2Fazure-jwt-verify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F99x%2Fazure-jwt-verify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F99x%2Fazure-jwt-verify/lists"}