question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting a key from KeyVault. UnhandledPromiseRejectionWarning: RestError: AKV10032: Invalid issuer. Expected one of ..

See original GitHub issue

Describe the bug I was following the docs how to reading key-valut in NodeJs+TS https://docs.microsoft.com/en-gb/javascript/api/overview/azure/keyvault-keys-readme?view=azure-node-latest

After following the steps in create KV, assign SP, and access policy and running example I get an error. This one looks like Authentication problem. RestError: AKV10032: Invalid issuer. Expected one of … - found https://sts.windows.net/1ff9bcf8-6255-4717-b.../.

$: node index.js 
(node:11788) UnhandledPromiseRejectionWarning: RestError: AKV10032: Invalid issuer. Expected one of https://sts.windows.net/72f988bf-86f1-.../, https://sts.windows.net/f8cdef31-a31e-4.../, https://sts.windows.net/e2d54eb5-3869-4.../, https://sts.windows.net/33e01921-4d.../, https://sts.windows.net/975f013f-7f24-47.../, found https://sts.windows.net/1ff9bcf8-6255-4717-b.../.
    at new RestError (/~/nodejs-key-vault/node_modules/@azure/core-http/dist/index.js:2387:28)
    at handleErrorResponse (/~/nodejs-key-vault/node_modules/@azure/core-http/dist/index.js:3238:17)
    at /~/nodejs-key-vault/node_modules/@azure/core-http/dist/index.js:3177:18
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
(node:11788) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:11788) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. follow - https://docs.microsoft.com/en-gb/javascript/api/overview/azure/keyvault-keys-readme?view=azure-node-latest - ‘Getting a key’ section

  2. run

const { DefaultAzureCredential } = require("@azure/identity");
const { KeyClient } = require("@azure/keyvault-keys");

const credential = new DefaultAzureCredential();

const vaultName = "<YOUR KEYVAULT NAME>";
const url = `https://${vaultName}.vault.azure.net`;

const client = new KeyClient(url, credential);

const keyName = "MyKeyName";

async function main() {
  const latestKey = await client.getKey(keyName);
  console.log(`Latest version of the key ${keyName}: `, latestKey);
  const specificKey = await client.getKey(keyName, { version: latestKey.properties.version! });
  console.log(`The key ${keyName} at the version ${latestKey.properties.version!}: `, specificKey);
}

main();

Expected behavior Login and display KV details

Screenshots If applicable, add screenshots to help explain your problem.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
shershen08commented, Nov 23, 2020

yes, approach with ClientSecretCredential using:

let credential = new ClientSecretCredential("<AZURE_TENANT_ID>", "<AZURE_CLIENT_ID>", "<AZURE_CLIENT_SECRET>");.

worked well, thanks @sadasant

via CLI also I could get details

0reactions
sadasantcommented, Nov 24, 2020

@shershen08 thank you for your response! Good luck on your project and keep in mind that you’re welcome here anytime 🌞

Read more comments on GitHub >

github_iconTop Results From Across the Web

RestError: AKV10032: Invalid issuer #13036 - GitHub
This issue points to a problem in the data-plane of the library. · Issues that are reported by GitHub users external to the...
Read more >
Azure Key Vault REST API Error Codes - Microsoft Learn
These error codes could be returned by an operation on an Azure Key Vault web service.
Read more >
Get Secret from Azure Keyvault using nodejs - Stack Overflow
js application the key to retrieve the list of users? I tried the below one but gave error and I am not sure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found