{"id":15290621,"url":"https://github.com/intility/msal-keyvault-cache","last_synced_at":"2025-04-13T10:20:18.409Z","repository":{"id":57118960,"uuid":"465784844","full_name":"intility/msal-keyvault-cache","owner":"intility","description":"A cache for @azure/msal-node that uses Azure KeyVault as a store.","archived":false,"fork":false,"pushed_at":"2024-07-23T12:56:04.000Z","size":112,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-27T01:46:35.519Z","etag":null,"topics":["azure","azure-key-vault","azure-keyvault","cache","key-vault","keyvault","keyvault-secrets","msal","msal-node","token-cache"],"latest_commit_sha":null,"homepage":"","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/intility.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}},"created_at":"2022-03-03T15:52:44.000Z","updated_at":"2024-07-23T12:56:03.000Z","dependencies_parsed_at":"2022-08-22T23:31:27.127Z","dependency_job_id":null,"html_url":"https://github.com/intility/msal-keyvault-cache","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intility%2Fmsal-keyvault-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intility%2Fmsal-keyvault-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intility%2Fmsal-keyvault-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intility%2Fmsal-keyvault-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intility","download_url":"https://codeload.github.com/intility/msal-keyvault-cache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248696018,"owners_count":21147051,"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","azure-key-vault","azure-keyvault","cache","key-vault","keyvault","keyvault-secrets","msal","msal-node","token-cache"],"created_at":"2024-09-30T16:08:48.777Z","updated_at":"2025-04-13T10:20:18.385Z","avatar_url":"https://github.com/intility.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"https://avatars.githubusercontent.com/u/35199565\" width=\"124px\"/\u003e\u003cbr/\u003e\n  @intility/msal-keyvault-cache\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  A cache for @azure/msal-node that uses Azure KeyVault as a store. \n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Intility/msal-keyvault-cache/actions\"\u003e\n    \u003cimg alt=\"pipeline\" src=\"https://github.com/Intility/msal-keyvault-cache/actions/workflows/publish.yml/badge.svg\" style=\"max-width:100%;\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@intility/msal-keyvault-cache\"\u003e\n    \u003cimg alt=\"package version\" src=\"https://img.shields.io/npm/v/@intility/msal-keyvault-cache?label=%40intility%2Fmsal-keyvault-cache\" style=\"max-width:100%;\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Usage\n\nInstall with\n\n```\nnpm install @intility/msal-keyvault-cache\n```\n\nThen, initialize the cache and use it in your client configuration\n\n```js\nimport { PublicClientApplication } from \"@azure/msal-node\";\nimport keyVaultCache from \"@intility/msal-keyvault-cache\";\n\nlet cachePlugin = keyVaultCache(\"https://YOUR_KEYVAULT_HERE.vault.azure.net/\");\n\nlet publicClientConfig = {\n  auth: {\n    clientId: \"CLIENT_ID\",\n    authority: \"https://login.microsoftonline.com/TENANT_ID\",\n  },\n  cache: {\n    cachePlugin,\n  },\n};\n\nlet publicClientApplication = new PublicClientApplication(publicClientConfig);\n```\n\nBy default, it will authenticate to the KeyVault by using [`DefaultAzureCredential` from '@azure/identity'](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/README.md#defaultazurecredential). This means you can authenticate a number of ways. In CI you can use [environment variables](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/README.md#defaultazurecredential), and locally you can use the Azure CLI.\n\n### Syntax\n\n```js\nlet cachePlugin = keyVaultCache(keyVaultUrl);\nlet cachePlugin = keyVaultCache(keyVaultUrl, secretName);\nlet cachePlugin = keyVaultCache(keyVaultUrl, secretName, credential);\n```\n\n### Parameters\n\n#### `keyVaultUrl`\n\nA JavaScript string containing the url to your Azure KeyVault.\n\n#### `secretName` (optional)\n\n- Default Value: `\"msal-cache\"`\n\nA JavaScript string containing the name of the secret.\n\n#### `credential` (optional)\n\n- Default Value: `new DefaultAzureCredential()`\n\nA [`Credential Class`](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/README.md#credential-classes) used to authenticate to the Azure KeyVault.\n\n### Return value\n\nA `cachePlugin` that can be used in a `@azure/msal-node` Client Configuration.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintility%2Fmsal-keyvault-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintility%2Fmsal-keyvault-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintility%2Fmsal-keyvault-cache/lists"}