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.

"Request is missing a Bearer or PoP token." with Client token

See original GitHub issue
  • Package Name: @azure/keyvault-secrets
  • Package Version: “^4.1.0”
  • Operating system: Windows 10
  • nodejs
    • version: 14.8.0
  • browser
    • name/version: Chrome/84.0.4147.135
  • typescript
    • version: “^3.9.6”
  • Is the bug related to documentation in

Describe the bug Access Azure Key Vault from Gatsby/React app Initiate access with

        this.keyVaultUri = `https://${keyVaultName}.vault.azure.net`;
        const credential = new ClientSecretCredential(tenantId, clientId, clientSecret);
        this.keyVaultClient = new SecretClient(this.keyVaultUri, credential);

Get a specific secret lke

    get GoogleMapApiKey() {
        return (async () => await this.keyVaultClient.getSecret('GoogleMapApiKey'));
    }

Get the secret value like:

        const mapsKey:KeyVaultSecret = await keyVault.GoogleMapApiKey();
        setGoogleMapsApiKey(mapsKey.value ?? '' );

To Reproduce Steps to reproduce the behavior: Illustrated in the description

Expected behavior Should retrieve the secret from the Azure Key Vault.

Additional context This seems related to #9005. This is a Gatsby React app. I am using TypeScript.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:29 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
KevinBurtoncommented, Aug 26, 2020

One more thought for which I have NO experience is to add Azure function to the app. Since it is already being deployed to static web site on Azure this seems like a natural place to put a function?

Again thank you for the help.

Kevin

On Wed, Aug 26, 2020 at 1:05 PM Daniel Rodríguez notifications@github.com wrote:

@KevinBurton https://github.com/KevinBurton that’s a good spot to be in! So many things to learn! Alright, good luck with that study!

If you happen to find the solution before me, please report back.

I’ll put some time over the weekend trying to deploy a Gatsby App using Azure App Service and our KeyVault clients to see if I can come up with something else.

I’m also asking internally in case somebody else knows more than me about this.

In case none of us has a better answer soon, see you in some days! good luck!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Azure/azure-sdk-for-js/issues/10828#issuecomment-681037320, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUFM3XCCTFI5CIADUNDFS3SCVFFZANCNFSM4QKQB2IA .

1reaction
KevinBurtoncommented, Aug 26, 2020

It would. If you have time. Thank you.

Kevin

On Wed, Aug 26, 2020 at 1:01 PM Daniel Rodríguez notifications@github.com wrote:

@KevinBurton https://github.com/KevinBurton I might be able to dig deeper and try to deploy a Gatsby app myself later this week or next week, if that helps.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Azure/azure-sdk-for-js/issues/10828#issuecomment-681035623, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUFM3R75THFO4ADVLSCMB3SCVEZDANCNFSM4QKQB2IA .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Key Vault Request is missing a Bearer or PoP token
When I try to read the value of my secret in the web GUI via link of my secret : "https://REDACTED.vault.azure.net/secrets/REDIS-PASSWORD/ ...
Read more >
Accessing Key Vault with @azure/identity and get error ...
Accessing Key Vault with @azure/identity and get error 'Request is missing a Bearer or PoP token Error 401' · App Registered via Azure...
Read more >
How To Access Azure Key Vault Secrets Through Rest API ...
Go to certificates and secrets section => click on new client secret => Give ... Here, request url for access token can be...
Read more >
Authorizing requests - Postman Learning Center
Bearer tokens enable requests to authenticate using an access key, such as a JSON Web Token (JWT). The token is a text string,...
Read more >
How is pop token more secure than bearer token?
Bearer token if lost (during transit over the wire) can give the holder of the token same privileges as the genuine owner. POP...
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